当前位置: 首页>>代码示例>>PHP>>正文


PHP UserModel::getInfo方法代码示例

本文整理汇总了PHP中UserModel::getInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::getInfo方法的具体用法?PHP UserModel::getInfo怎么用?PHP UserModel::getInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserModel的用法示例。


在下文中一共展示了UserModel::getInfo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: passAction

 /**
  * 修改密码
  */
 public function passAction()
 {
     if ($this->_request->isPost()) {
         $data = array('uid' => $this->_request->getPost('uid'), 'password' => $this->_request->getPost('password'), 'confirmPwd' => $this->_request->getPost('confirmPwd'));
         try {
             $this->user->updateInfo($data['uid'], $data);
             $this->view->feedback(array('title' => '设置成功', 'message' => '密码修改成功'));
         } catch (Exception $e) {
             $this->view->feedback(array('title' => '发生错误', 'message' => '密码修改失败:' . $e->getMessage()));
         }
     }
     $uid = $this->_getParam('uid');
     $this->view->info = null;
     if ($uid > 0) {
         $this->view->info = $this->user->getInfo($uid);
     }
 }
开发者ID:BGCX261,项目名称:zhongyycode-svn-to-git,代码行数:20,代码来源:UserController.php

示例2: smarty_function_form

/**
 * Smarty {form} function plugin
 *
 * Type:     function<br>
 * Name:     form<br>
 * Purpose:  generates form from database<br>
 * @author Nathan Gardner <nathan@factory8.com>
 */
function smarty_function_form($localparams, &$smarty)
{
    global $params;
    if (!empty($localparams['identifier'])) {
        $objForm = new FormModel();
        $objAuth = Authentication::getInstance();
        $objTemplate = new TemplatesModel();
        $objUser = new UserModel($objAuth->user_id);
        $userInfo = $objUser->getInfo();
        $form_id = $objForm->getFormId($localparams['identifier']);
        if ($form_id) {
            $formInfo = $objForm->loadForm($form_id);
            $templateInfo = $objTemplate->loadTemplateFromKeyname('form');
            // assign values if already submitted
            if (!empty($params['formSubmit']['fields']) && !empty($formInfo['fields'])) {
                foreach ($formInfo['fields'] as &$formField) {
                    foreach ($params['formSubmit']['fields'] as $submittedId => $submittedValue) {
                        if ($formField['id'] == $submittedId) {
                            if ($formField['type'] == 'checkbox' || $formField['type'] == 'radio') {
                                $formField['checked'] = 'checked';
                            } else {
                                $formField['value'] = $submittedValue;
                            }
                            break;
                        }
                    }
                }
            }
            // assign error flag and message if invalid
            if (!empty($params['formErrors']) && !empty($formInfo['fields'])) {
                foreach ($params['formErrors'] as $formError) {
                    foreach ($formInfo['fields'] as &$formField) {
                        if ($formError['field_id'] == $formField['id']) {
                            $formField['hasError'] = true;
                            $formField['errorMsg'] = $formError['errorMsg'];
                            break;
                        }
                    }
                }
            }
            // assign var to template
            if (!empty($params['formSubmitted'])) {
                $smarty->assign('formSubmitted', 1);
            }
            if (!empty($params['formErrors'])) {
                $smarty->assign('formErrors', $params['formErrors']);
            }
            $smarty->assign('formInfo', $formInfo);
            $output = $smarty->fetch('fromstring:' . $templateInfo['content']);
        } else {
            return 'Unknown form identifier';
        }
    } else {
        return 'Must pass an identifier';
    }
    return $output;
}
开发者ID:ngardner,项目名称:BentoCMS,代码行数:65,代码来源:function.form.php

示例3: ActionRules

 public static function ActionRules()
 {
     $id = UserModel::getUserId();
     $dictionary = UserModel::getLangArray();
     $menuClass = [0 => 'active', 1 => '', 2 => '', 3 => '', 4 => '', 5 => ''];
     $view = 'templates/userProfile.php';
     $profile_content = 'templates/rules.php';
     $links = ['userProfile.css', 'webcam.css', 'rules.css'];
     $scripts = ['dragAndDropDownload.js', 'addPost.js', 'MediaAPI.js'];
     $user = UserModel::getInfo($id);
     include_once view . '/templates/template.php';
 }
开发者ID:yasch-kub,项目名称:social-network.com,代码行数:12,代码来源:ApplicationController.php

示例4: assignCommons

 function assignCommons()
 {
     global $params;
     ##prod info
     $this->assign('ProductTitle', PRODUCT_NAME);
     ##skin dir
     $this->assign('skin', '/' . $this->location . '/views/');
     $this->assign('bento', '/bento/');
     ##global url http/https
     if (empty($_SERVER["HTTPS"])) {
         $this->assign('httpUrl', 'http://' . URL . '/');
     } else {
         $this->assign('httpUrl', 'https://' . URL . '/');
     }
     ##site settings
     $objSettings = Settings::getInstance();
     $settings = $objSettings->getEntrys();
     $this->assign('Settings', $settings);
     $metaTitle = $settings['meta']['default-meta-title'];
     $metaDescription = $settings['meta']['default-meta-description'];
     $metaKeywords = $settings['meta']['default-meta-keywords'];
     if (!empty($params['_urlrequest'])) {
         $objUrls = new FriendlyurlModel();
         $objUrls->parseRequest($params['_urlrequest']);
         $urlMeta = $objUrls->getMetaData($objUrls->url_id);
         if (!empty($urlMeta['title'])) {
             $metaTitle = $urlMeta['title'];
         }
         if (!empty($urlMeta['description'])) {
             $metaDescription = $urlMeta['description'];
         }
         if (!empty($urlMeta['keywords'])) {
             $metaKeywords = $urlMeta['keywords'];
         }
         $this->assign('urlrequest', $params['_urlrequest']);
     }
     ##meta deta
     $this->assign('metaTitle', $metaTitle);
     $this->assign('metaDescription', $metaDescription);
     $this->assign('metaKeywords', $metaKeywords);
     ##global filesystem path
     $this->assign('fsPath', DIR);
     ##user vars
     $objAuthentication = Authentication::getInstance();
     if ($objAuthentication->loggedIn()) {
         $objUser = new UserModel($objAuthentication->user_id);
         $this->assign('loggedIn', true);
         $this->assign('UserInfo', $objUser->getInfo());
     } else {
         $this->assign('loggedIn', false);
     }
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:52,代码来源:View.php

示例5: actionEdituser

 function actionEdituser($params = '')
 {
     $objUser = new UserModel();
     $user_id = !empty($params['user_id']) ? intval($params['user_id']) : false;
     if (!empty($params['dosave'])) {
         $saveData = array();
         $saveData['id'] = !empty($params['user_id']) ? $params['user_id'] : false;
         $saveData['email'] = !empty($params['user_email']) ? $params['user_email'] : false;
         $saveData['password'] = !empty($params['user_password']) ? $params['user_password'] : false;
         $saveData['fName'] = !empty($params['user_fname']) ? $params['user_fname'] : false;
         $saveData['lName'] = !empty($params['user_lname']) ? $params['user_lname'] : false;
         $saveData['title'] = !empty($params['user_title']) ? $params['user_title'] : false;
         $saveData['type'] = !empty($params['user_type']) ? $params['user_type'] : 'user';
         $saveData['permissions'] = !empty($params['user_permissions']) ? $params['user_permissions'] : false;
         $user_id = $objUser->saveUser($saveData);
         if ($user_id) {
             $this->messages[] = array('type' => 'success', 'message' => 'User has been saved.');
             if ($params['submit'] == 'Save and Close') {
                 $this->actionIndex();
                 return;
             }
         } else {
             $this->messages[] = array('type' => 'error', 'message' => $objUser->errorMsg);
         }
     }
     if ($user_id) {
         $objUser->setUserId($user_id);
     }
     $userInfo = $objUser->getInfo();
     $this->view->assign('userInfo', $userInfo);
     $permissions = $objUser->permissions->getUserPermissionTable($user_id);
     $this->view->assign('permissions', $permissions);
     $this->view->assign('content', $this->view->fetch('tpl/administration/user.tpl'));
     $this->view->assign('messages', $this->messages);
     $this->finish();
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:36,代码来源:Users.php

示例6: actionDialog

 public static function actionDialog($chatId)
 {
     $dictionary = UserModel::getLangArray();
     $menuClass = [0 => '', 1 => '', 2 => 'active', 3 => '', 4 => ''];
     $userStyle = UserModel::getUserStyle();
     $id = UserModel::getUserId();
     $user = UserModel::getInfo($id);
     $messages = ChatModel::getChatMessages($chatId);
     if (ChatModel::isUserInChat($chatId, UserModel::getUserId())) {
         $lastMessage = end($messages);
         $timestamp = $lastMessage['timestamp'];
         $view = 'templates/userProfile.php';
         $profile_content = 'templates/dialog.php';
         $links = ['userProfile.css', 'dialog.css', 'webcam.css'];
         $scripts = ['dragAndDropDownload.js', 'follow.js', 'messager.js', 'MediaAPI.js'];
         include_once view . '/templates/template.php';
     } else {
         header('Location: /rules');
     }
 }
开发者ID:yasch-kub,项目名称:social-network.com,代码行数:20,代码来源:UserController.php

示例7: actionAccount

 function actionAccount($params = '')
 {
     $userModel = new UserModel($this->objAuthentication->user_id);
     if (!empty($params['manageAccount']) && $params['manageAccount'] == 1) {
         $objValidator = new Validator();
         $objValidator->reset();
         if (!empty($params['user_password'])) {
             $objValidator->validatePassword($params['user_password']);
             $objValidator->passwordsMatch($params['user_password'], $params['user_password2']);
         }
         if ($objValidator->hasError) {
             $this->view->assign('errorMessages', $objValidator->getError());
         } else {
             $userInfo = array();
             if (!empty($params['user_password'])) {
                 $userInfo['password'] = $params['user_password'];
                 $userInfo['email'] = $params['user_email'];
                 $userUpdated = $userModel->manageUser($userInfo);
                 if ($userUpdated) {
                     $this->view->assign('successMessage', 'Your account has been updated.');
                 } else {
                     $this->view->assign('errorMessages', array('Unable to update your account'));
                 }
             }
         }
     }
     $this->view->assign('userInfo', $userModel->getInfo());
     $this->view->assign('content', $this->view->fetch('tpl/community/account.tpl'));
     $this->finish();
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:30,代码来源:Community.php

示例8: sendOrderAdmin

 function sendOrderAdmin($order_id)
 {
     $objEmailer = new Emailer();
     $objLayout = new LayoutModel();
     $objTemplate = new TemplatesModel();
     $objOrder = new OrderModel();
     $objUser = new UserModel();
     $objSettings = Settings::getInstance();
     $adminEmail = $objSettings->getEntry('admin', 'admin-email');
     $layoutInfo = $objLayout->loadLayout(28);
     $template = $objTemplate->loadTemplateFromKeyname('email-order');
     // load order
     $orderInfo = $objOrder->getOrder($order_id);
     $objUser->setUserId($orderInfo['user_id']);
     $userInfo = $objUser->getInfo();
     // assign to template
     $this->view->assign('adminView', true);
     $this->view->assign('orderInfo', $orderInfo);
     $this->view->assign('userInfo', $userInfo);
     // render template
     $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content']));
     $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar']));
     $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar']));
     // send email
     $objEmailer->setFrom('noreply@parksassociates.com');
     $objEmailer->addTo($adminEmail, "Parks Associates");
     $objEmailer->setSubject('NEW PURCHASE');
     $objEmailer->setBody($this->view->fetch('fromstring:' . $layoutInfo['code']), true);
     $objEmailer->sendMail();
     // see if we also need to send webcast registration email
     if (!empty($orderInfo['webcasts'])) {
         foreach ($orderInfo['webcasts'] as $webcast) {
             // see if its in the future
             if (strtotime($webcast['eventDate']) > time()) {
                 // send them email
                 $this->sendWebcastRegistrationAdmin($orderInfo);
                 break;
                 // only need to send once
             }
         }
     }
     return true;
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:43,代码来源:EmailSender.php

示例9: actionProfile

 function actionProfile($params = '')
 {
     $message = !empty($params['message']) ? $params['message'] : false;
     $this->objAuthentication->requiresAccount();
     $userModel = new UserModel($this->objAuthentication->user_id);
     $userInfo = $userModel->getInfo();
     $objLayout = new LayoutModel();
     $objTemplate = new TemplatesModel();
     $layoutInfo = $objLayout->loadLayout();
     $template = $objTemplate->loadTemplateFromKeyname('user-profile');
     $this->view->assign('message', $message);
     $this->view->assign('userInfo', $userInfo);
     $this->view->assign('content', $this->view->fetch('fromstring:' . $template['content']));
     $this->view->assign('sidebar_left', $this->view->fetch('fromstring:' . $template['left_sidebar']));
     $this->view->assign('sidebar_right', $this->view->fetch('fromstring:' . $template['right_sidebar']));
     $this->view->assign('layout', $this->view->fetch('fromstring:' . $layoutInfo['code']));
     $this->finish();
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:18,代码来源:User.php


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