ewiki info
READMEChangeLog
project site
fm project page
secondary site
|
Your own userdb pluginIf you have an existing user database and management system, you'll probably like to just reuse that one for ewiki. In this case you just needed to write a custom ["auth_userdb"] plugin. <?php define("EWIKI_PROTECTED_MODE+", 1); define("EWIKI_AUTH_DEFAULT_RING+", 3); // read-only for unregistered $ewiki_plugins["auth_userdb"][] = "my_userdb"; function my_userdb($user,$pw) { $result = mysql_query("SELECT * FROM users WHERE user='$user'"); if ($row = mysql_fetch_array($result)) { if ($flags & USERFLAG_ADMIN) { $ring = 1; // moderator user } else { $ring = 2; // ordinary user, may edit/ pages } return( array($row["password"], $ring) ); } } ?> In this example, we fetched the user data from a MySQL database table 'users' with the rows 'name' containing the usernames, 'password' containing encrypted or unencrypted (?don't care) password. The 'flags' database column also tells wether the fetched user gets moderator priviliges (ring 1) or not (ring level 2). Most SQL user databases are layed out like this one, despite the fictional 'flags' column of course. If your database had an 'email' field as well, you could add this to reflect it: $GLOBALS["ewiki_author"] = $row["email"];prev << "Your own userdb plugin" next >> "Your own perm plugin" You cannot modify the ProtectedMode file, but anyhow any ideas or suggestion should as usually get filed on BugReports, UserSuggestions or even better the ProtectedMode.Discussion. |