Changeset 542

Show
Ignore:
Timestamp:
09/13/06 12:37:54 (2 years ago)
Author:
ben
Message:

A far more secure initialisation method for the news account - users specify an initial password in config.php and are instructed to change it upon first login. Additionally, every time a user logs in with the password 'password', they get a telling off.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/config-dist.php

    r520 r542  
    2828    $CFG->sysadminemail = ''; 
    2929 
     30// Account 1, with username news, is initially administrator. This 
     31// will be its initial password - UPON INSTALLATION, YOU SHOULD LOG 
     32// IN AS NEWS AND CHANGE THE PASSWORD IMMEDIATELY. 
     33 
     34    $CFG->newsinitialpassword = ''; 
     35     
    3036// Country code to set language to if you have gettext installed 
    3137// To include new languages, save their compiled .mo gettext 
  • devel/lib/dbsetup.php

    r517 r542  
    2020$strdatabasesuccess = "Yay!"; // well, if people leave never-defined variables about the place... 
    2121 
     22$newinstall = false; 
     23 
    2224if (!$maintables) { 
    2325    if (file_exists($CFG->dirroot . "lib/db/$CFG->dbtype.sql")) { 
     
    2830            $db->debug = false; 
    2931            notify($strdatabasesuccess, "green"); 
     32            if (!isset($CFG->newsinitialpassword) || empty($CFG->newsinitialpassword)) { 
     33                notify("WARNING: the initial password for the news account is 'password'. This account has administrator privileges, and you should log in and change the password as soon as installation is complete."); 
     34            } else { 
     35                $newspassword = $db->qstr(md5($CFG->newsinitialpassword)); 
     36                execute_sql("update ".$CFG->prefix."users set password = $newspassword where username = 'news'"); 
     37            } 
     38            execute_sql("update ".$CFG->prefix."users set email = ". $db->qstr($CFG->sysadminemail) ." where username = 'news'"); 
    3039        } else { 
    3140            $db->debug = false; 
  • devel/sanitychecks.php

    r506 r542  
    2929        $diemessages[] = 'Configuration problem: The <code>$CFG->dataroot</code> setting in config.php must end with a forward slash (/).'; 
    3030    } 
    31      
    3231     
    3332    if (ini_get('register_globals')) {