本文整理汇总了PHP中Model_Users类的典型用法代码示例。如果您正苦于以下问题:PHP Model_Users类的具体用法?PHP Model_Users怎么用?PHP Model_Users使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Model_Users类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: docUserLogAction
public function docUserLogAction()
{
//$this->_helper->layout->setLayout('main');
$users = new Model_Users();
$doc_user_log = $users->getDocUserLog();
$this->view->result = $doc_user_log;
}
示例2: sendMails
public function sendMails($data)
{
$config = (include_once 'config/main.php');
$result = array('status' => 'success', 'message' => 'Сообщения успешно разосланы!');
// Получаем всех пользователей
$model = new Model_Users();
$users = $model->getUsersMailing(intval($data['id_group']));
if (!$users) {
$result['status'] = 'error';
$result['message'] = 'Пользователи не найдены!';
return $result;
}
//Формируем адресатов
$addresses = [];
for ($i = 0; $i < count($users); $i++) {
if ($users[$i]->name) {
$addresses[$i]['name'] = $users[$i]->name;
} else {
$addresses[$i]['name'] = 'пользователь сайта LoftShop';
}
$addresses[$i]['email'] = $users[$i]->email;
}
$username = 'пользователь сайта LoftShop';
$letter = ['preview' => $data['subject'], 'title' => $data['title'], 'username' => $username, 'body' => $data['body']];
$bodyHtml = $this->view->render('admin/mailing/letter_template.twig', array('letter' => $letter));
$bodyText = 'Здравствуйте, ' . $username . '! ' . $data['body'] . ' С уважением, администрация сайта LoftShop!';
$sendStatus = $this->sendMailMany($config['email']['adminname'], $config['email']['adminemail'], $config['email']['adminpassword'], $addresses, $data['subject'], $bodyHtml, $bodyText);
if (!$sendStatus) {
$result['status'] = 'error';
$result['message'] = 'Не удалось отправить сообщения=(';
return $result;
}
return $result;
}
示例3: deleteAction
public function deleteAction()
{
$role = new Model_Users();
$role_id = $_GET['role_id'];
$role->deleteRole($role_id);
$this->redirect('giaovu/role/list');
}
示例4: index
function index()
{
$model = new Model_Users();
$userInfo = $model->getUser(2);
$this->template->vars('userInfo', $userInfo);
$this->template->view('index');
}
示例5: calificacionautomatica
public function calificacionautomatica($idempresa, $users, $estado)
{
if ($estado == "4") {
$proyecto = 1;
if ($users == "564") {
$userid = 564;
$deptocalifica = 2;
} else {
$ouser = new Model_Users();
$deptocalifica = $ouser->iddeptouser($users->id);
$userid = $users->id;
}
$notafinal1 = $this->califica($idempresa, $proyecto, $deptocalifica);
$calificaciones = ORM::factory('calificaciones');
$calificaciones->id_empresa = $idempresa;
$calificaciones->id_user = $userid;
$calificaciones->calificacion = $notafinal1;
$calificaciones->comentario = "Nota para proyectos en Vivienda Nueva (GENERADO POR EL SISTEMA)";
$calificaciones->fecha_registro = date('Y-m-d H:i:s');
$calificaciones->id_clasificacion = "1";
$calificaciones->save();
$proyecto = 2;
$notafinal2 = $this->califica($idempresa, $proyecto, $deptocalifica);
$calificaciones = ORM::factory('calificaciones');
$calificaciones->id_empresa = $idempresa;
$calificaciones->id_user = $userid;
$calificaciones->calificacion = $notafinal2;
$calificaciones->comentario = "Nota para proyectos PMAR (GENERADO POR EL SISTEMA)";
$calificaciones->fecha_registro = date('Y-m-d H:i:s');
$calificaciones->id_clasificacion = "1";
$calificaciones->save();
}
}
示例6: _getArticleObjectFromData
protected static function _getArticleObjectFromData(\stdClass $article_data)
{
$author = new Model_Users($article_data->author_username);
$author->prop('id', $article_data->author_id);
$category = new Model_Categories($article_data->category_name);
$category->prop('id', $article_data->category_id);
return new Model_Articles(['id' => $article_data->id, 'title' => $article_data->title, 'introduction' => $article_data->introduction, 'content' => $article_data->content, 'date_publication' => $article_data->date_publication, 'date_last_update' => $article_data->date_last_update, 'is_published' => $article_data->is_published, 'author' => $author, 'category' => $category]);
}
示例7: recoverAction
public function recoverAction()
{
$user_id = $_GET['user_id'];
$user = new Model_Users();
//$user->deleteUserRole($user_id);
$user->recoverUser($user_id);
$this->redirect('giaovu/user/list');
}
示例8: action_index
public function action_index()
{
$oUser = new Model_Users();
$users = $oUser->listaGeneral();
if (sizeof($users) > 0) {
$this->template->content = View::factory('admin/users')->bind('users', $users);
}
}
示例9: isValid
public function isValid($value, $context = null)
{
$usersModel = new Model_Users();
if ($usersModel->userIsValid($context['email'], $value)) {
return true;
}
$this->_error(self::NOT_MATCH);
return false;
}
示例10: isValid
public function isValid($value)
{
$usersModel = new Model_Users();
if ($usersModel->emailExists($value)) {
$this->_error(self::MAIL_TAKEN);
return false;
}
return true;
}
示例11: isValid
public function isValid($value)
{
$modelUsers = new Model_Users();
$user = $modelUsers->fetchWithEmail($value);
if (!$user) {
$this->_error(self::INVALID_USER_EMAIL);
return false;
}
return true;
}
示例12: login
/**
* Autenticação de Usuário
*
* Apresentando como primeiro parâmetro o e-mail do usuário e como segundo o
* seu hash cadastrado no sistema, será apresentado um token de autenticação
* resultante se as credenciais apresentadas estiverem válidas.
*
* @param string $email E-mail Utilizado pelo Usuário
* @param string $hash Hash Cadastrado para o E-mail
* @return string Token de Autenticação
*/
public function login()
{
// Captura de Parâmetros
$email = (string) func_get_arg(0);
$hash = (string) func_get_arg(1);
// Camada de Modelo
$model = new Model_Users();
// Processamento
$result = $model->login($email, $hash);
// Apresentação
return $result;
}
示例13: indexAction
public function indexAction()
{
$form = new Form_Cadmin_UserSearch();
$form_add = new Form_Cadmin_User();
$params = array();
$users = new Model_Users();
if ($this->_request->isPost()) {
if ($form->isValid($this->_request->getPost())) {
$loginid = $form->getValue('login_id');
$role_id = $form->getValue('role');
if (!empty($loginid)) {
$params['loginId'] = $loginid;
}
if (!empty($role_id)) {
$params['role'] = $role_id;
}
}
} else {
$loginid = $this->_getParam('login_id');
$role_id = $this->_getParam('role');
if (!empty($loginid)) {
$params['loginId'] = $loginid;
$form->login_id->setValue($loginid);
}
if (!empty($role_id)) {
$params['role'] = $role_id;
$form->role->setValue($role_id);
}
}
$sort = $this->_getParam("sort", "asc");
$order = $this->_getParam("order", "login_id");
$users->form_values = $params;
$result = $users->getUsers($order, $sort);
//Paginate the contest results
$paginator = Zend_Paginator::factory($result);
$page = $this->_getParam("page", 1);
$counter = $this->_getParam("counter", 10);
$paginator->setCurrentPageNumber((int) $page);
$paginator->setItemCountPerPage((int) $counter);
$this->view->form = $form;
$this->view->form_add = $form_add;
$this->view->paginator = $paginator;
$this->view->sort = $sort;
$this->view->order = $order;
$this->view->counter = $counter;
$this->view->pagination_params = $params;
$base_url = Zend_Registry::get('baseurl');
$this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos.js');
$this->view->inlineScript()->appendFile($base_url . '/common/bootstrap/extend/jasny-bootstrap/js/jasny-bootstrap.min.js');
$this->view->inlineScript()->appendFile($base_url . '/common/bootstrap/extend/jasny-bootstrap/js/bootstrap-fileupload.js');
$this->view->headLink()->appendStylesheet($base_url . '/common/bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap.min.css');
$this->view->headLink()->appendStylesheet($base_url . '/common/bootstrap/extend/jasny-bootstrap/css/jasny-bootstrap-responsive.min.css');
}
示例14: addeditAction
/**
* Function addeditAction for add and edit the user's information.
*/
public function addeditAction()
{
$asUser = Zend_Json_Decoder::decode($this->getRequest()->getParam('ssUserDetail'), Zend_Json::TYPE_ARRAY);
if ($asUser['id_user'] == 0) {
$oUser = new Model_Users();
$oUser->saveUser($asUser);
} else {
$oUser = Model_UsersTable::updateUser($asUser);
}
$asResponse = array('status' => 'success', 'massage' => 'Record added or edited successfully');
echo Zend_Json_Encoder::encode($asResponse);
exit;
}
示例15: accountAction
public function accountAction()
{
$lecturer_id = $this->sessionGlobal->lecturer_id;
$user = new Model_Users();
$findUser = $user->findOneUser($lecturer_id);
$this->view->findUser = $findUser;
if ($this->_request->isPost()) {
$data = $this->_getParam('searchParam');
$user->updateUser($data);
echo "Thành công";
header("Refresh:0");
}
}