includes/sessions.php
changeset 1206 50f6c144ec68
parent 1205 c922ef08167a
child 1211 488294ceee13
equal deleted inserted replaced
1205:c922ef08167a 1206:50f6c144ec68
   438     list($page_id, $namespace) = RenderMan::strToPageID($urlname);
   438     list($page_id, $namespace) = RenderMan::strToPageID($urlname);
   439     list($page_id) = explode('/', $page_id);
   439     list($page_id) = explode('/', $page_id);
   440     
   440     
   441     if ( $strict )
   441     if ( $strict )
   442     {
   442     {
   443       return $namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout', 'LangExportJSON'));
   443       return $namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout', 'LangExportJSON', 'ActivateAccount'));
   444     }
   444     }
   445     else
   445     else
   446     {
   446     {
   447       return $namespace == 'Admin' || ($namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout', 'Administration')));
   447       return $namespace == 'Admin' || ($namespace == 'Special' && in_array($page_id, array('CSS', 'Login', 'Logout', 'Administration', 'LangExportJSON', 'ActivateAccount')));
   448     }
   448     }
   449   }
   449   }
   450   
   450   
   451   # Session restoration and permissions
   451   # Session restoration and permissions
   452   
   452   
  2262     if ( $db->numrows() > 0 )
  2262     if ( $db->numrows() > 0 )
  2263     {
  2263     {
  2264       $new_key = md5(AESCrypt::randkey());
  2264       $new_key = md5(AESCrypt::randkey());
  2265       $this->sql('UPDATE ' . table_prefix . 'users SET account_active = 1, activation_key = \'' . $new_key . '\' WHERE username=\''.$db->escape($user).'\' AND activation_key=\''.$db->escape($key).'\';');
  2265       $this->sql('UPDATE ' . table_prefix . 'users SET account_active = 1, activation_key = \'' . $new_key . '\' WHERE username=\''.$db->escape($user).'\' AND activation_key=\''.$db->escape($key).'\';');
  2266       $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
  2266       $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_good\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
       
  2267       return true;
  2267     }
  2268     }
  2268     else
  2269     else
  2269     {
  2270     {
  2270       $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
  2271       $this->sql('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary) VALUES(\'security\', \'activ_bad\', '.time().', \''.enano_date(ED_DATE | ED_TIME).'\', \''.$db->escape($user).'\', \''.$_SERVER['REMOTE_ADDR'].'\')');
  2271     }
  2272       return false;
  2272     return $r;
  2273     }
  2273   }
  2274   }
  2274   
  2275   
  2275   /**
  2276   /**
  2276    * For a given user level identifier (USER_LEVEL_*), returns a string describing that user level.
  2277    * For a given user level identifier (USER_LEVEL_*), returns a string describing that user level.
  2277    * @param int User level
  2278    * @param int User level