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


PHP iaUsers::reloadIdentity方法代码示例

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


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

示例1: _deleteFile

 private function _deleteFile($params)
 {
     $result = array('error' => true, 'message' => iaLanguage::get('invalid_parameters'));
     $item = isset($params['item']) ? iaSanitize::sql($params['item']) : null;
     $field = isset($params['field']) ? iaSanitize::sql($params['field']) : null;
     $path = isset($params['path']) ? iaSanitize::sql($params['path']) : null;
     $itemId = isset($params['itemid']) ? (int) $params['itemid'] : null;
     if ($itemId && $item && $field && $path) {
         $tableName = $this->_iaCore->factory('item')->getItemTable($item);
         $itemValue = $this->_iaDb->one($field, iaDb::convertIds($itemId), $tableName);
         $iaAcl = $this->_iaCore->factory('acl');
         if ($iaAcl->isAdmin() && $itemValue) {
             $pictures = $itemValue[1] == ':' ? unserialize($itemValue) : $itemValue;
             $key = null;
             if (is_array($pictures)) {
                 if ($primitive = !is_array($pictures[key($pictures)])) {
                     $pictures = array($pictures);
                 }
                 foreach ($pictures as $k => $v) {
                     if ($path == $v['path']) {
                         $key = $k;
                         break;
                     }
                 }
                 if (!is_null($key)) {
                     unset($pictures[$key]);
                 }
                 $newItemValue = $primitive ? '' : serialize($pictures);
             } else {
                 // single image
                 $newItemValue = '';
                 if ($pictures == $path) {
                     $key = true;
                 }
             }
             if (!is_null($key)) {
                 if ($this->_iaCore->factory('picture')->delete($path)) {
                     if ($this->_iaDb->update(array($field => $newItemValue), iaDb::convertIds($itemId), null, $tableName)) {
                         if (iaUsers::getItemName() == $item) {
                             // update current profile data
                             if ($itemId == iaUsers::getIdentity()->id) {
                                 iaUsers::reloadIdentity();
                             }
                         }
                     }
                     $result['error'] = false;
                     $result['message'] = iaLanguage::get('deleted');
                 } else {
                     $result['message'] = iaLanguage::get('error');
                 }
             }
         }
     }
     return $result;
 }
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:55,代码来源:actions.php

示例2: _entryUpdate

 protected function _entryUpdate(array $entryData, $entryId)
 {
     $result = $this->getHelper()->update($entryData, iaDb::convertIds($entryId), array('date_update' => iaDb::FUNCTION_NOW));
     if ($result && $entryId == iaUsers::getIdentity()->id) {
         iaUsers::reloadIdentity();
     }
     return $result;
 }
开发者ID:nicefirework,项目名称:subrion,代码行数:8,代码来源:members.php

示例3: _indexPage

 protected function _indexPage(&$iaView)
 {
     $iaView->display('index');
     $iaCore =& $this->_iaCore;
     $iaDb =& $this->_iaDb;
     if (isset($_GET['reset']) || isset($_GET['save'])) {
         $data = isset($_GET['list']) ? $_GET['list'] : '';
         if ($iaDb->update(array('admin_columns' => $data), iaDb::convertIds(iaUsers::getIdentity()->id), null, iaUsers::getTable())) {
             iaUsers::reloadIdentity();
         }
         $iaView->setMessages(iaLanguage::get('saved'), iaView::SUCCESS);
         iaUtil::go_to(IA_SELF);
     }
     $disabledWidgets = iaUsers::getIdentity()->admin_columns;
     $disabledWidgets = empty($disabledWidgets) ? array() : explode(',', trim($disabledWidgets, ','));
     $iaView->assign('disabled_widgets', $disabledWidgets);
     $customizationMode = isset($_GET['customize']) && empty($_GET['customize']);
     if ($customizationMode) {
         $iaView->setMessages(iaLanguage::get('customization_mode_alert'));
         $iaView->assign('customization_mode', true);
     }
     // populate statistics
     $iaItem = $iaCore->factory('item');
     $itemsList = $iaItem->getPackageItems();
     $validSizes = array('small', 'medium', 'package');
     $iaCore->startHook('adminDashboardStatistics', array('items' => &$itemsList));
     natcasesort($itemsList);
     $statistics = array();
     foreach ($validSizes as $size) {
         $statistics[$size] = array();
     }
     foreach ($itemsList as $itemName => $pluginType) {
         $itemName = substr($itemName, 0, -1);
         switch ($pluginType) {
             case 'core':
                 $classInstance = $iaCore->factory('member' == $itemName ? 'users' : $itemName);
                 break;
             case 'plugin':
                 $array = explode(':', $itemName);
                 $itemName = isset($array[1]) ? $array[1] : $itemName;
                 $classInstance = $iaCore->factoryPlugin($array[0], iaCore::ADMIN, isset($array[1]) ? $array[1] : null);
                 break;
             default:
                 $classInstance = $iaCore->factoryPackage($itemName, $pluginType, iaCore::ADMIN);
         }
         if (!$customizationMode && in_array($itemName, $disabledWidgets)) {
             continue;
         }
         if ($classInstance) {
             if (method_exists($classInstance, self::STATISTICS_GETTER_METHOD)) {
                 if ($classInstance->dashboardStatistics) {
                     $data = $classInstance->{self::STATISTICS_GETTER_METHOD}();
                     isset($data['icon']) || ($data['icon'] = $itemName);
                     isset($data['caption']) || ($data['caption'] = $itemName);
                     $data['caption'] = iaLanguage::get($data['caption'], $data['caption']);
                     $widgetFormat = isset($data['_format']) && in_array($data['_format'], $validSizes) ? $data['_format'] : $validSizes[0];
                     $statistics[$widgetFormat][$itemName] = $data;
                 }
             }
         }
     }
     $iaView->assign('statistics', $statistics);
     //
     if (($customizationMode || !in_array('changelog', $disabledWidgets)) && $iaCore->get('display_changelog') && is_file(IA_HOME . 'changelog.txt')) {
         $index = 0;
         $log = array();
         $titles = array();
         $lines = file(IA_HOME . 'changelog.txt');
         foreach ($lines as $line_num => $line) {
             $line = trim($line);
             if ($line) {
                 if ($line[0] == '>') {
                     $index++;
                     $log[$index] = array('title' => trim($line, '<> '), 'added' => '', 'modified' => '', 'bugfixes' => '', 'other' => '');
                     $titles[trim($line, '<> ')] = $index;
                 } elseif ($index > 0) {
                     switch ($line[0]) {
                         case '+':
                             $class = 'added';
                             break;
                         case '-':
                             $class = 'bugfixes';
                             break;
                         case '*':
                             $class = 'modified';
                             break;
                         default:
                             $class = 'other';
                     }
                     $issue = preg_replace('/#(\\d+)/', '<a href="http://dev.subrion.org/issues/$1" target="_blank">#$1</a>', ltrim($line, '+-* '));
                     $log[$index][$class] .= '<li>' . $issue . '</li>';
                 }
             }
         }
         unset($log[0]);
         ksort($titles);
         $titles = array_reverse($titles);
         $iaView->assign('changelog_titles', $titles);
         $iaView->assign('changelog', $log);
     }
//.........这里部分代码省略.........
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:101,代码来源:index.php

示例4: array

             } else {
                 // single image
                 $newValue = '';
                 if ($pictures == $path) {
                     $key = true;
                 }
             }
             if ($key !== false) {
                 $iaDb->update(array($field => $newValue), iaDb::convertIds($itemId), null, $tableName);
                 $iaPicture = $iaCore->factory('picture');
                 $iaPicture->delete($path);
                 $output = array('error' => false, 'message' => iaLanguage::get('deleted'));
                 if (iaUsers::getItemName() == $item) {
                     // update current profile data
                     if ($itemId == iaUsers::getIdentity()->id) {
                         iaUsers::reloadIdentity();
                     }
                 }
             }
         }
     }
     break;
 case 'send_email':
     $output['message'] = array();
     $memberInfo = $iaCore->factory('users')->getInfo((int) $_POST['author_id']);
     if (empty($memberInfo) || $memberInfo['status'] != iaCore::STATUS_ACTIVE) {
         $output['message'][] = iaLanguage::get('member_doesnt_exist');
     }
     if (empty($_POST['from_name'])) {
         $output['message'][] = iaLanguage::get('incorrect_fullname');
     }
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:31,代码来源:actions.php

示例5: extractFunds

 /**
  * Write funds off from member balance.
  *
  * @param array $transactionData data about transaction
  *
  * @return bool true on success
  */
 public function extractFunds(array $transactionData)
 {
     if (!iaUsers::hasIdentity()) {
         return false;
     }
     $iaUsers = $this->iaCore->factory('users');
     $iaTransaction = $this->iaCore->factory('transaction');
     $userInfo = $iaUsers->getInfo(iaUsers::getIdentity()->id);
     $remainingBalance = $userInfo['funds'] - $transactionData['amount'];
     if ($remainingBalance >= 0) {
         $result = (bool) $iaUsers->update(array('funds' => $remainingBalance), iaDb::convertIds(iaUsers::getIdentity()->id));
         if ($result) {
             iaUsers::reloadIdentity();
             $updatedValues = array('status' => iaTransaction::PASSED, 'gateway' => iaTransaction::TRANSACTION_MEMBER_BALANCE, 'reference_id' => date('YmdHis'), 'member_id' => iaUsers::getIdentity()->id);
             $iaTransaction->update($updatedValues, $transactionData['id']);
         }
         return $result;
     }
     return false;
 }
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:27,代码来源:ia.core.plan.php


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