當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。