Index: branches/unlabeled/unlabeled-1.68.2/core/units/users/users_event_handler.php =================================================================== diff -u -r7504 -r7526 --- branches/unlabeled/unlabeled-1.68.2/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 7504) +++ branches/unlabeled/unlabeled-1.68.2/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 7526) @@ -144,9 +144,11 @@ $login_value = $this->Application->GetVar($submit_field); // process "Save Username" checkbox - $save_username = $this->Application->GetVar('cb_save_username') ? $login_value : ''; - $this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration - $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery + if ($this->Application->IsAdmin()) { + $save_username = $this->Application->GetVar('cb_save_username') ? $login_value : ''; + $this->Application->Session->SetCookie('save_username', $save_username, adodb_mktime() + 31104000); // 1 year expiration + $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery + } if ($this->Application->IsAdmin() && ($login_value == 'root')) { // logging in "root" (admin only) Index: branches/unlabeled/unlabeled-1.6.2/core/install.php =================================================================== diff -u -r7525 -r7526 --- branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7525) +++ branches/unlabeled/unlabeled-1.6.2/core/install.php (.../install.php) (revision 7526) @@ -526,7 +526,20 @@ function GetModuleVersion($module_name) { - return '0.1.1'; + $upgrades_file = sprintf(UPGRADES_FILE, 'core/'); + if (!file_exists($upgrades_file)) { + // no upgrade file + return '4.0.0'; + } + + $sqls = file_get_contents($upgrades_file); + $versions_found = preg_match_all('/# ===== v ([\d]+\.[\d]+\.[\d]+) =====/s', $sqls, $regs); + if (!$versions_found) { + // upgrades file doesn't contain version definitions + return '4.0.0'; + } + + return end($regs[1]); } function ConnectToDatabase()