本文整理汇总了PHP中erLhcoreClassModelUser::setPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelUser::setPassword方法的具体用法?PHP erLhcoreClassModelUser::setPassword怎么用?PHP erLhcoreClassModelUser::setPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModelUser
的用法示例。
在下文中一共展示了erLhcoreClassModelUser::setPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$UserData->hide_online = 0;
}
if ($form->hasValidData('UserInvisible') && $form->UserInvisible == true) {
$UserData->invisible_mode = 1;
} else {
$UserData->invisible_mode = 0;
}
$globalDepartament = array();
if (isset($_POST['all_departments']) && $_POST['all_departments'] == 'on') {
$UserData->all_departments = 1;
$globalDepartament[] = 0;
} else {
$UserData->all_departments = 0;
}
if (count($Errors) == 0) {
$UserData->setPassword($form->Password);
$UserData->email = $form->Email;
$UserData->name = $form->Name;
$UserData->username = $form->Username;
erLhcoreClassUser::getSession()->save($UserData);
if (isset($_POST['UserDepartament']) && count($_POST['UserDepartament']) > 0) {
$globalDepartament = array_merge($_POST['UserDepartament'], $globalDepartament);
}
if (count($globalDepartament) > 0) {
erLhcoreClassUserDep::addUserDepartaments($globalDepartament, $UserData->id, $UserData);
}
erLhcoreClassModelGroupUser::removeUserFromGroups($UserData->id);
foreach ($UserData->user_groups_id as $group_id) {
$groupUser = new erLhcoreClassModelGroupUser();
$groupUser->group_id = $group_id;
$groupUser->user_id = $UserData->id;
示例2: int
//Assing group role
$db->query("CREATE TABLE IF NOT EXISTS `lh_grouprole` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `group_id` int(11) NOT NULL,\n `role_id` int(11) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `group_id` (`role_id`,`group_id`),\n KEY `group_id_primary` (`group_id`)\n ) DEFAULT CHARSET=utf8;");
// Assign admin role to admin group
$GroupRole = new erLhcoreClassModelGroupRole();
$GroupRole->group_id = $GroupData->id;
$GroupRole->role_id = $Role->id;
erLhcoreClassRole::getSession()->save($GroupRole);
// Assign operators role to operators group
$GroupRoleOperators = new erLhcoreClassModelGroupRole();
$GroupRoleOperators->group_id = $GroupDataOperators->id;
$GroupRoleOperators->role_id = $RoleOperators->id;
erLhcoreClassRole::getSession()->save($GroupRoleOperators);
// Users
$db->query("CREATE TABLE IF NOT EXISTS `lh_users` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `username` varchar(40) NOT NULL,\n `password` varchar(40) NOT NULL,\n `email` varchar(100) NOT NULL,\n `time_zone` varchar(100) NOT NULL,\n `name` varchar(100) NOT NULL,\n `surname` varchar(100) NOT NULL,\n `filepath` varchar(200) NOT NULL,\n `filename` varchar(200) NOT NULL,\n `job_title` varchar(100) NOT NULL,\n `xmpp_username` varchar(200) NOT NULL,\n `skype` varchar(50) NOT NULL,\n `disabled` tinyint(4) NOT NULL,\n `hide_online` tinyint(1) NOT NULL,\n `all_departments` tinyint(1) NOT NULL,\n `invisible_mode` tinyint(1) NOT NULL,\n `rec_per_req` tinyint(1) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `hide_online` (`hide_online`),\n KEY `rec_per_req` (`rec_per_req`),\n KEY `email` (`email`),\n KEY `xmpp_username` (`xmpp_username`)\n ) DEFAULT CHARSET=utf8;");
$UserData = new erLhcoreClassModelUser();
$UserData->setPassword($form->AdminPassword);
$UserData->email = $form->AdminEmail;
$UserData->name = $form->AdminName;
$UserData->surname = $form->AdminSurname;
$UserData->username = $form->AdminUsername;
$UserData->all_departments = 1;
erLhcoreClassUser::getSession()->save($UserData);
// User departaments
$db->query("CREATE TABLE IF NOT EXISTS `lh_userdep` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t\t `dep_id` int(11) NOT NULL,\n\t\t\t\t `last_activity` int(11) NOT NULL,\n\t\t\t\t `hide_online` int(11) NOT NULL,\n\t\t\t\t `last_accepted` int(11) NOT NULL,\n\t\t\t\t `active_chats` int(11) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t KEY `user_id` (`user_id`),\n\t\t\t\t KEY `last_activity_hide_online_dep_id` (`last_activity`,`hide_online`,`dep_id`),\n\t\t\t\t KEY `dep_id` (`dep_id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Insert record to departament instantly
$db->query("INSERT INTO `lh_userdep` (`user_id`,`dep_id`,`last_activity`,`hide_online`,`last_accepted`,`active_chats`) VALUES ({$UserData->id},0,0,0,0,0)");
// Transfer chat
$db->query("CREATE TABLE IF NOT EXISTS `lh_transfer` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `chat_id` int(11) NOT NULL,\n\t\t\t\t `dep_id` int(11) NOT NULL,\n\t\t\t\t `transfer_user_id` int(11) NOT NULL,\n\t\t\t\t `from_dep_id` int(11) NOT NULL,\n\t\t\t\t `transfer_to_user_id` int(11) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t KEY `dep_id` (`dep_id`),\n\t\t\t\t KEY `transfer_user_id_dep_id` (`transfer_user_id`,`dep_id`),\n\t\t\t\t KEY `transfer_to_user_id` (`transfer_to_user_id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Remember user table
$db->query("CREATE TABLE IF NOT EXISTS `lh_users_remember` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t\t `mtime` int(11) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Chat messages