function _init_dataspace() { $object_data =& fetch_mapped_by_url(); $phpbb_users_db_table =& db_table_factory::create('phpbb_users'); $conditions['user_id'] = $object_data['id']; $list = $phpbb_users_db_table->get_list($conditions); if (!count($list)) { return; } $phpbb_user_data = current($list); $data['rank'] = $phpbb_user_data['user_rank']; $this->dataspace->import($data); }
function change_own_password($password) { if (!($node_id = user::get_node_id())) { debug::write_error('user not logged in - node id is not set', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__); return false; } $data['password'] = user::get_crypted_password(user::get_login(), $password); $user_db_table =& db_table_factory::create('user'); if ($user_db_table->update($data, 'identifier="' . user::get_login() . '"')) { return user::login(user::get_login(), $password); } else { return false; } }
function change_own_password($password) { $user =& user::instance(); if (!($node_id = $user->get_node_id())) { debug::write_error('user not logged in - node id is not set', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__); return false; } $data['password'] = $user->get_crypted_password($user->get_login(), $password); $user_db_table =& db_table_factory::create('user'); $this->set_attribute('password', $data['password']); if ($user_db_table->update($data, 'identifier="' . $user->get_login() . '"')) { return $this->login($user->get_login(), $password); } else { return false; } }
* * $Id$ * ***********************************************************************************/ if (isset($argv[1])) { $project_dir = $argv[1]; } else { die('project dir required'); } require_once $project_dir . '/setup.php'; require_once LIMB_DIR . '/core/lib/db/db_table_factory.class.php'; require_once LIMB_DIR . '/core/controllers/site_object_controller.class.php'; $site_object_db_table = db_table_factory::create('sys_site_object'); $class_db_table = db_table_factory::create('sys_class'); $action_access_db_table = db_table_factory::create('sys_action_access'); $group_object_access_template_db_table = db_table_factory::create('sys_group_object_access_template'); $user_object_access_template_db_table = db_table_factory::create('sys_user_object_access_template'); $classes = $class_db_table->get_list(); foreach ($classes as $class) { $class_id = $class['id']; $controller_name = $class['class_name'] . '_controller'; $controller_id = site_object_controller::get_id($controller_name); $conditions['class_id'] = $class_id; $row['controller_id'] = $controller_id; $site_object_db_table->update($row, $conditions); $action_access_db_table->update($row, $conditions); $group_object_access_template_db_table->update($row, $conditions); $user_object_access_template_db_table->update($row, $conditions); echo $class['class_name'] . " objects updated...\n"; } echo 'done';
function login($login, $password) { $this->_delete_cookie(); $user_ip = sys::client_ip(true); $sid = md5(uniqid($user_ip)); session::set('phpbb_sid', $sid); $phpbb_user_data = array(); $phpbb_user_data['session_user_id'] = user::get_id(); $phpbb_user_data['session_id'] = $sid; $phpbb_user_data['session_ip'] = $user_ip; $phpbb_user_data['session_logged_in'] = 1; $phpbb_user_data['session_start'] = time(); $phpbb_user_data['session_time'] = time(); $db_table =& db_table_factory::create('phpbb_sessions'); return $db_table->insert($phpbb_user_data); }