4 This plugin provides a user 'database' by using the internal/system
5 page "system/passwd". You first must create that page (to do so, please
6 enter a URL like "?id=edit/system/passwd" manually), and initially
7 create one user at least. Inside of this page you should list one
8 user per line, in the following format (without spaces!):
10 username:password:ringlevel
13 Where the ringlevel is optional and the passwords can be in cleartext(),
14 crypt(), md5() or sha1() encoding. The privilege ("ring") levels have
17 1 - moderator (delete, ...)
18 2 - ordinary user (edit, ...)
19 3 - browsing only (view, info, ...)
20 The level 1 is the default for everyone you'll notice inside of the
21 "system/passwd" control page. First create a superuser (ring level 0),
22 because only this person can edit _SYSTEM pages (the "system/passwd"
23 will get automatically this flag).
26 - EWIKI_PROTECTED_MODE
27 - plugins/auth_perm_ring.php (or _perm_unix.php)
28 - plugins/auth_method_http.php (or another one)
33 define("EWIKI_USERDB_SYSTEMPASSWD", "system/passwd");
37 $ewiki_plugins["auth_userdb"][] = "ewiki_auth_userdb_systempasswd";
41 function ewiki_auth_userdb_systempasswd($username, $password) {
46 if (empty($username)) return;
49 $data = ewiki_db::GET(EWIKI_USERDB_SYSTEMPASSWD);
52 if (($data["version"]) && !($data["flags"] & EWIKI_DB_F_SYSTEM)) {
53 $data["flags"] |= EWIKI_DB_F_SYSTEM;
55 ewiki_db::WRITE($data);
60 foreach (explode("\n",$data["content"]) as $line) {
65 if (strtok($line, ":") == $username) {
68 $entry = explode(":", strtok("\377"));
70 #-- add default ring level
71 if (!isset($entry[1])) {