Changeset 1538

Show
Ignore:
Timestamp:
12/19/2009 11:03:16 AM (9 months ago)
Author:
BrianKoontz
Message:

Admin properly created during install. Refs #912.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.3/setup/install.php

    r1536 r1538  
    225225        mysql_query("insert into ".$config['table_prefix']."acls set page_tag = 'DatabaseInfo', read_acl = '!*', write_acl = '!*', comment_read_acl = '!*', comment_post_acl = '!*'", $dblink); 
    226226 
    227         // 
    228         // Auto login wiki admin 
    229         // 
     227        // Register admin user 
     228        $challenge = dechex(crc32(time())); 
     229        // Delete existing admin user in case installer was run twice 
     230        @mysql_query('delete from '.$config['table_prefix'].'users where name = \''.$config['admin_users'].'\'', $dblink); 
     231    test(__('Adding admin user').'...', 
     232                @mysql_query("insert into ".$config["table_prefix"]."users set name = '".$config["admin_users"]."', password = md5('".mysql_real_escape_string($_POST['password'])."'), email = '".$config["admin_email"]."', signuptime = now(), challenge='".$challenge."'", $dblink), "Hmm!", 0); 
     233 
     234        // Auto-login wiki admin 
    230235        // Set default cookie path 
    231236        test("Setting initial session cookies for auto-login...", 1);