~hazon/hazon/hazon_newest

« back to all changes in this revision

Viewing changes to Administrators/login.php

  • Committer: Liel Fridman
  • Date: 2010-01-13 15:01:18 UTC
  • Revision ID: liel@home-savta-20100113150118-4e9kiwl372dylhf2
Returning to MySQL

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
function secure($in) {
4
4
    return htmlspecialchars(pg_escape_string($in));
5
5
}
6
 
$link = pg_connect("host=$pgsql_host port=$pgsql_port dbname=$pgsql_database username=$pgsql_username password=$pgsql_password",PGSQL_CONNECT_FORCE_NEW) or die('שגיאת PostgreSQL: לא יכול להתחבר למסד הנתונים. האם אתה בטוח שהוא קיים?');
 
6
$link = pg_connect("host=$pgsql_host port=$pgsql_port dbname=$pgsql_database user=$pgsql_username password=$pgsql_password",PGSQL_CONNECT_FORCE_NEW) or die('שגיאת PostgreSQL: לא יכול להתחבר למסד הנתונים. האם אתה בטוח שהוא קיים?');
 
7
pg_set_client_encoding($link, "UNICODE");
7
8
$username = secure($_POST['username']);
8
9
$password = md5(iconv('UTF-8','windows-1255',$_POST['pass']));
9
10
$dbd = pg_query($link,'SELECT * FROM hazon_admin_users WHERE username="'.$username.'";');
13
14
}
14
15
if (iconv('UTF-8','windows-1255',$dbd_array['password']) == $password) {
15
16
    $_SESSION['username'] = $username;
16
 
    //setcookie('username',$username,time()+3600);
17
 
    //setcookie('password',$password,time()+3600);
18
17
    $_SESSION['password'] = $password;
19
18
    header('Location: cp.php');
20
19
}