config_dir = "{$Config['dir_root']}".'config_dir/'; $smarty->template_dir = "{$Config['dir_root']}".'templates/'; $smarty->cache_dir = "{$Config['dir_root']}".'cache_dir/'; $smarty->compile_dir = "{$Config['dir_root']}".'compile_dir/'; $smarty->force_compile = true; $smarty->caching = false; ?>getMessage()); } $db->setOption('autofree', true); $db->setFetchMode(DB_FETCHMODE_ASSOC); $db->query("SET NAMES CP1251"); $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); ?> user_id) { $check_acl_sql = "SELECT t2.*,t1.is_root FROM `{$Config['db_prefix']}users` as t1 LEFT JOIN `{$Config['db_prefix']}group` as t2 ON t1.group_id=t2.group_id WHERE t1.user_id = {intval($this->user_id)}"; $check_acl_sql_res = $db->query($check_acl_sql); $check_acl_sql_arr = $check_acl_sql_res->fetchRow(); $this->is_root = $check_acl_sql_arr['is_root']; $this->user_manager = $check_acl_sql_arr['user_manager']; $this->upload_songs = $check_acl_sql_arr['upload_songs']; $this->approve_songs = $check_acl_sql_arr['approve_songs']; $this->trusted_users = $check_acl_sql_arr['trusted_users']; $this->group_changer = $check_acl_sql_arr['group_changer']; return true; } return false; } function login($login,$password) { global $db,$Config; $login = mysql_real_escape_string($login); if (!strlen($login) || !strlen($password)) {return false;} $login_sql = "SELECT t1.password,t1.user_id FROM `{$Config['db_prefix']}users` as t1 WHERE t1.login='{$login}'"; $login_sql_res = $db->query($login_sql); $login_sql_arr = $login_sql_res->fetchRow(); if ($password == $login_sql_arr['password']) { $this->login = $login; $this->user_id = $login_sql_arr['user_id']; return $this->check_acl(); } } } ?>user_id) { $check_acl_sql = "SELECT t2.*,t1.is_root FROM `{$Config['db_prefix']}users` as t1 LEFT JOIN `{$Config['db_prefix']}group` as t2 ON t1.group_id=t2.group_id WHERE t1.user_id = {intval($this->user_id)}"; $check_acl_sql_res = $db->query($check_acl_sql); $check_acl_sql_arr = $check_acl_sql_res->fetchRow(); $this->is_root = $check_acl_sql_arr['is_root']; $this->user_manager = $check_acl_sql_arr['user_manager']; $this->upload_songs = $check_acl_sql_arr['upload_songs']; $this->approve_songs = $check_acl_sql_arr['approve_songs']; $this->trusted_users = $check_acl_sql_arr['trusted_users']; $this->group_changer = $check_acl_sql_arr['group_changer']; $this->moderate_comments = $check_acl_sql_arr['moderate_comments']; return true; } return false; } function login($login,$password) { global $db,$Config; $login = mysql_real_escape_string($login); if (!strlen($login) || !strlen($password)) {return false;} $login_sql = "SELECT t1.password,t1.user_id FROM `{$Config['db_prefix']}users` as t1 WHERE t1.login='{$login}' AND active=1"; $login_sql_res = $db->query($login_sql); $login_sql_arr = $login_sql_res->fetchRow(); if ($password == $login_sql_arr['password']) { $this->login = $login; $this->user_id = $login_sql_arr['user_id']; return $this->check_acl(); } } function md5login($login,$password) { global $db,$Config; $login = mysql_real_escape_string($login); if (!strlen($login) || !strlen($password)) {return false;} $login_sql = "SELECT t1.password,t1.user_id FROM `{$Config['db_prefix']}users` as t1 WHERE t1.login='{$login}' AND t1.active=1"; $login_sql_res = $db->query($login_sql); $login_sql_arr = $login_sql_res->fetchRow(); if ($password == md5($login_sql_arr['password'].'galaradio')) { $this->login = $login; $this->user_id = $login_sql_arr['user_id']; return $this->check_acl(); } } } ?>query($select_user); $select_user_arr = $select_user_res -> fetchRow(); if ($select_user_arr[login]) { return $select_user_arr; } else { return false; } } } ?>