本文整理匯總了PHP中User_Model::set_password方法的典型用法代碼示例。如果您正苦於以下問題:PHP User_Model::set_password方法的具體用法?PHP User_Model::set_password怎麽用?PHP User_Model::set_password使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類User_Model
的用法示例。
在下文中一共展示了User_Model::set_password方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _map_posted_data
private function _map_posted_data()
{
$user_model = new User_Model();
$user_model->set_user_name($_POST['user_name']);
$user_model->set_first_name($_POST['first_name']);
$user_model->set_last_name($_POST['last_name']);
$user_model->set_contact_number($_POST['contact_number']);
if (isset($_POST['user_type'])) {
$user_model->set_user_type($_POST['user_type']);
}
$user_model->set_user_status($_POST['user_status']);
if (isset($_POST['password'])) {
$user_model->set_password($_POST['password']);
}
if ($_POST['user_type'] == 'organization') {
$user_model->set_name($_POST['name']);
$user_model->set_doe($_POST['doe']);
$user_model->set_address($_POST['address']);
$user_model->set_objective($_POST['objective']);
//store file
$filename = $_FILES['img']['name'];
$path = PUBLIC_PATH . "/pictures/orgPictures/";
move_uploaded_file($_FILES['img']['tmp_name'], $path . $filename);
$savepath = PUBLIC_PATH2 . "/pictures/orgPictures/";
$user_model->set_img($savepath . $filename);
} elseif ($_POST['user_type'] == 'welfare') {
$user_model->set_welf_name($_POST['welf_name']);
$user_model->set_welf_doe($_POST['welf_doe']);
$user_model->set_welf_service($_POST['welf_service']);
$user_model->set_welf_address($_POST['welf_address']);
$user_model->set_welf_objective($_POST['welf_objective']);
//store file
$filename = $_FILES['img']['name'];
$path = PUBLIC_PATH . "/pictures/welfPictures/";
move_uploaded_file($_FILES['img']['tmp_name'], $path . $filename);
$savepath = PUBLIC_PATH2 . "/pictures/welfPictures/";
$user_model->set_welf_img($savepath . $filename);
}
return $user_model;
}
示例2: get_all_users
public function get_all_users()
{
$res = $this->connection->query("SELECT * FROM userdb", PDO::FETCH_LAZY);
$users = array();
global $logged_user;
$i = 0;
foreach ($res as $row) {
if ($row['uid'] == $logged_user->uid) {
continue;
}
$cur_user = new User_Model();
$cur_user->set_login($row['login']);
$cur_user->set_password($row['pass']);
$cur_user->set_email($row['email']);
$cur_user->set_role($row['role']);
$cur_user->set_status($row['status']);
$cur_user->set_name($row['name']);
$cur_user->set_surname($row['surname']);
$cur_user->set_uid($row['uid']);
$users[$i] = $cur_user;
$i++;
}
return $users;
}