本文整理汇总了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;
}