Ejemplo n.º 1
0
 function query_mult_assoc($query)
 {
     global $log_all, $log_error;
     if ($result = mysql_query(quote_smart($query))) {
         while ($row = mysql_fetch_assoc($result)) {
             $array[] = $row;
         }
         if ($log_all == 1) {
             logSQL($query);
         }
         return isset($array) ? $array : '';
     }
     if ($log_error == 1) {
         logSQL($query . " - Error: " . mysql_error());
     } else {
         mysql::error($query . " - " . mysql_error());
     }
 }
Ejemplo n.º 2
0
 public static function login($login, $pw)
 {
     global $mysql;
     $query = "SELECT password FROM peq_admin WHERE login=\"{$login}\"";
     $result = $mysql->query_assoc($query);
     if ($result == '') {
         $_SESSION['error'] = 1;
         logSQL("Invalid login attempt. Bad username from IP: '" . getIP() . "'. Username: '******' Password: '******'.");
         return;
     }
     extract($result);
     if ($password == md5($pw)) {
         $_SESSION['login'] = $login;
         $_SESSION['password'] = md5($pw);
     } else {
         $_SESSION['error'] = 1;
         logSQL("Invalid login attempt. Bad password from IP: '" . getIP() . "'. Username: '******' Password: '******'.");
     }
 }