• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Model_Users类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Model_Users的典型用法代码示例。如果您正苦于以下问题:PHP Model_Users类的具体用法?PHP Model_Users怎么用?PHP Model_Users使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Model_Users类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:7,代码来源:DocsController.php


示例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;
 }
开发者ID:Antoshka007,项目名称:php_dz5,代码行数:34,代码来源:controller_mailing.php


示例3: deleteAction

 public function deleteAction()
 {
     $role = new Model_Users();
     $role_id = $_GET['role_id'];
     $role->deleteRole($role_id);
     $this->redirect('giaovu/role/list');
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:7,代码来源:RoleController.php


示例4: index

 function index()
 {
     $model = new Model_Users();
     $userInfo = $model->getUser(2);
     $this->template->vars('userInfo', $userInfo);
     $this->template->view('index');
 }
开发者ID:andxbes,项目名称:ArchetypePHPMVC,代码行数:7,代码来源:Index.php


示例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();
     }
 }
开发者ID:sysdevbol,项目名称:entidad,代码行数:33,代码来源:rankingempresas.php


示例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]);
 }
开发者ID:adrien-gueret,项目名称:le-chomp-enchaine,代码行数:8,代码来源:Articles.php


示例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');
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:8,代码来源:UserController.php


示例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);
     }
 }
开发者ID:sysdevbol,项目名称:entidad,代码行数:8,代码来源:user.php


示例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;
 }
开发者ID:georgetutuianu,项目名称:licenta,代码行数:9,代码来源:Credentials.php


示例10: isValid

 public function isValid($value)
 {
     $usersModel = new Model_Users();
     if ($usersModel->emailExists($value)) {
         $this->_error(self::MAIL_TAKEN);
         return false;
     }
     return true;
 }
开发者ID:georgetutuianu,项目名称:licenta,代码行数:9,代码来源:EmailNotTaken.php


示例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;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:10,代码来源:User.php


示例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;
 }
开发者ID:laiello,项目名称:wanderson,代码行数:23,代码来源:Compiler.php


示例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');
 }
开发者ID:uppaljs,项目名称:pakistan-vlmis-v2,代码行数:53,代码来源:ManageUsersController.php


示例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;
 }
开发者ID:nainit-virtueinfo,项目名称:zend-rest,代码行数:16,代码来源:RestserverController.php


示例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");
     }
 }
开发者ID:phamviet1510,项目名称:giaovu,代码行数:13,代码来源:InfoController.php


示例16: isValid

 public function isValid($value)
 {
     if ($value == $this->excludeAddress) {
         return true;
     }
     $modelUsers = new Model_Users();
     $user = $modelUsers->fetchWithEmail($value);
     if ($user) {
         $this->_error('Email already registered');
         return false;
     }
     return true;
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:13,代码来源:NotUser.php


示例17: searchAction

 public function searchAction()
 {
     $q = $this->_getParam('q');
     if ($q) {
         $modelUsers = new Model_Users();
         $users = $modelUsers->search($q);
         $this->view->users = $users;
         $this->view->q = $q;
         $this->view->usersFound = count($users);
     } else {
         $this->view->usersFound = 0;
     }
     $this->_helper->layout->disableLayout();
 }
开发者ID:AlexanderMazaletskiy,项目名称:gym-Tracker-App,代码行数:14,代码来源:IndexController.php


示例18: saveUser

 public function saveUser($oFormValue = array())
 {
     if (!is_array($oFormValue) || empty($oFormValue)) {
         return false;
     }
     $ousers = new Model_Users();
     $ousers->email = $oFormValue['email'];
     $ousers->password = md5($oFormValue['password']);
     $ousers->first_name = ucfirst($oFormValue['first_name']);
     $ousers->last_name = ucfirst($oFormValue['last_name']);
     $ousers->city = ucfirst($oFormValue['city']);
     $ousers->save();
     return true;
 }
开发者ID:nainit-virtueinfo,项目名称:zend-rest,代码行数:14,代码来源:Model_Users.php


示例19: indexAction

 public function indexAction()
 {
     $where = '';
     $category = null;
     if ($this->getRequest()->getQuery('username')) {
         $userinfo = Model_Users::getByUsername($this->getRequest()->getQuery('username'));
         if ($userinfo) {
             $where = "users.username = '" . $this->getRequest()->getQuery('username') . "'";
         }
     }
     if ($this->getRequest()->getQuery('category')) {
         $catinfo = Model_Categories::get($this->getRequest()->getQuery('category'));
         if ($catinfo) {
             $category = $this->getRequest()->getQuery('category');
         }
     }
     $items = Model_Items::getAll($category, 0, 20, 'id desc', $where);
     $this->view->item = array();
     if ($items) {
         $model_images = new Model_Images();
         $categories = Model_Categories::get_all();
         foreach ($items as $item) {
             $categories_string = '';
             if ($category) {
                 foreach ($item['categories'] as $cats) {
                     if (in_array($category, $cats)) {
                         foreach ($cats as $cat) {
                             if (isset($categories[$cat]['name'])) {
                                 $categories_string .= $categories_string ? ' › ' : '';
                                 $categories_string .= $categories[$cat]['name'];
                             }
                         }
                         break;
                     }
                 }
             } else {
                 $cats = array_pop($item['categories']);
                 if ($cats && is_array($cats)) {
                     foreach ($cats as $cat) {
                         if (isset($categories[$cat]['name'])) {
                             $categories_string .= $categories_string ? ' › ' : '';
                             $categories_string .= $categories[$cat]['name'];
                         }
                     }
                 }
             }
             if ((int) JO_Registry::get($item['module'] . '_items_preview_width') && (int) JO_Registry::get($item['module'] . '_items_preview_height')) {
                 $item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resize($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_width'), JO_Registry::forceGet($item['module'] . '_items_preview_height'), true);
             } elseif ((int) JO_Registry::get($item['module'] . '_items_preview_width')) {
                 $item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resizeWidth($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_width'));
             } elseif ((int) JO_Registry::get($item['module'] . '_items_preview_height')) {
                 $item['theme_preview_thumbnail'] = $this->getRequest()->getBaseUrl() . $model_images->resizeHeight($item['theme_preview_thumbnail'], JO_Registry::forceGet($item['module'] . '_items_preview_height'));
             } else {
                 $item['theme_preview_thumbnail'] = false;
             }
             $this->view->item[] = array('title' => $item['name'], 'link' => WM_Router::create($this->getRequest()->getBaseUrl() . '?module=' . $item['module'] . '&controller=items&item_id=' . $item['id']), 'description' => html_entity_decode($item['description'], ENT_QUOTES, 'utf-8'), 'author' => $item['username'], 'category' => $categories_string, 'guid' => $item['id'], 'enclosure' => $item['theme_preview_thumbnail'], 'pubDate' => JO_Date::getInstance($item['datetime'], JO_Date::RSS_FULL, true)->toString());
         }
     }
     echo $this->renderScript('rss');
 }
开发者ID:noikiy,项目名称:PD,代码行数:60,代码来源:RssController.php


示例20: action_index

 public function action_index()
 {
     try {
         $helper = new FacebookRedirectLoginHelper(Config::get('login_url'));
         $session = $helper->getSessionFromRedirect();
     } catch (FacebookRequestException $ex) {
         // When Facebook returns an error
     } catch (\Exception $ex) {
         // When validation fails or other local issues
     }
     if (isset($session)) {
         //login succes
         $long_lived_session = $session->getLongLivedSession();
         $access_token = $long_lived_session->getToken();
         //*** Call api to get user info
         $user_info = $this->facebook->get_user_information($access_token);
         //*** Check if user has existed
         $user = Model_Users::find('first', array('where' => array('fb_id' => $user_info->getId())));
         if (empty($user)) {
             // Register user
             if (Model_Users::register_user($user_info, $access_token)) {
                 //Success
             }
         }
         //*** Set session for user
         Fuel\Core\Session::set('user_token', $long_lived_session->getToken());
         Fuel\Core\Session::set('user_id', $user_info->getId());
         //*** Redirect to home
         \Fuel\Core\Response::redirect('fanpage/index');
     } else {
         // login fail
         $this->template->login_url = $helper->getLoginUrl();
     }
 }
开发者ID:nguyen-phuoc-mulodo,项目名称:mfb_fuel,代码行数:34,代码来源:login.php



注:本文中的Model_Users类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ModeleBoxes类代码示例发布时间:2022-05-23
下一篇:
PHP Model_User类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap