diff options
-rw-r--r-- | database/database.mysql | 4 | ||||
-rw-r--r-- | database/database.pgsql | 4 | ||||
-rw-r--r-- | modules/user.module | 21 | ||||
-rw-r--r-- | modules/user/user.module | 21 |
4 files changed, 8 insertions, 42 deletions
diff --git a/database/database.mysql b/database/database.mysql index 5befddba7..78c62f8a1 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -577,7 +577,11 @@ INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0); INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0); INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0); INSERT INTO users (uid, name, mail, rid) VALUES ('0', '', '', '1'); + +INSERT INTO role (rid, name) VALUES (1, 'anonymous user'); INSERT INTO permission VALUES (1,'access content',0); + +INSERT INTO role (rid, name) VALUES (2, 'authenticated user'); INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0); REPLACE variable SET name='update_start', value='s:10:"2003-10-27;"'; diff --git a/database/database.pgsql b/database/database.pgsql index 46a82926f..636f51e6d 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -578,7 +578,11 @@ INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-10-27";'); INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";'); INSERT INTO users(uid,name,mail,rid) VALUES(0,'','', '1'); + +INSERT INTO role (rid, name) VALUES (1, 'anonymous user'); INSERT INTO permission VALUES (1,'access content',0); + +INSERT INTO role (rid, name) VALUES (2, 'authenticated user'); INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0); INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1'); diff --git a/modules/user.module b/modules/user.module index 2048c6685..68c2b6eb7 100644 --- a/modules/user.module +++ b/modules/user.module @@ -827,8 +827,6 @@ function user_register($edit = array()) { $from = variable_get("site_mail", ini_get("sendmail_from")); $pass = user_password(); - // create new user account, noting whether administrator approval is required - user_role_init(); // TODO: is this necessary? Won't session_write replicate this? unset($edit["session"]); $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data)); @@ -1497,29 +1495,11 @@ function user_admin_account() { return theme("table", $header, $rows); } -function user_role_init() { - $role = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = 'anonymous user'")); - if (!$role) { - db_query("INSERT INTO {role} (name) VALUES ('anonymous user')"); - } - - $role = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = 'authenticated user'")); - if (!$role) { - db_query("INSERT INTO {role} (name) VALUES ('authenticated user')"); - } -} - function user_admin() { $op = $_POST["op"]; $edit = $_POST["edit"]; if (user_access("administer users")) { - /* - ** Initialize all the roles and permissions: - */ - - user_role_init(); - if (empty($op)) { $op = arg(2); } @@ -1789,4 +1769,3 @@ function user_help_page() { } ?> - diff --git a/modules/user/user.module b/modules/user/user.module index 2048c6685..68c2b6eb7 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -827,8 +827,6 @@ function user_register($edit = array()) { $from = variable_get("site_mail", ini_get("sendmail_from")); $pass = user_password(); - // create new user account, noting whether administrator approval is required - user_role_init(); // TODO: is this necessary? Won't session_write replicate this? unset($edit["session"]); $account = user_save("", array_merge(array("name" => $edit["name"], "pass" => $pass, "init" => $edit["mail"], "mail" => $edit["mail"], "rid" => _user_authenticated_id(), "status" => (variable_get("user_register", 1) == 1 ? 1 : 0)), $data)); @@ -1497,29 +1495,11 @@ function user_admin_account() { return theme("table", $header, $rows); } -function user_role_init() { - $role = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = 'anonymous user'")); - if (!$role) { - db_query("INSERT INTO {role} (name) VALUES ('anonymous user')"); - } - - $role = db_fetch_object(db_query("SELECT * FROM {role} WHERE name = 'authenticated user'")); - if (!$role) { - db_query("INSERT INTO {role} (name) VALUES ('authenticated user')"); - } -} - function user_admin() { $op = $_POST["op"]; $edit = $_POST["edit"]; if (user_access("administer users")) { - /* - ** Initialize all the roles and permissions: - */ - - user_role_init(); - if (empty($op)) { $op = arg(2); } @@ -1789,4 +1769,3 @@ function user_help_page() { } ?> - |