本文整理汇总了PHP中iaUsers类的典型用法代码示例。如果您正苦于以下问题:PHP iaUsers类的具体用法?PHP iaUsers怎么用?PHP iaUsers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了iaUsers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: isScriptInstalled
public static function isScriptInstalled()
{
if (!file_exists(IA_HOME . 'includes' . IA_DS . self::CONFIGURATION_FILE)) {
return false;
}
self::loadCoreClass('users', 'core');
return iaCore::instance()->iaDb->one_bind(iaDb::STMT_COUNT_ROWS, '`usergroup_id` = :group AND `date_logged` IS NOT NULL', array('group' => iaUsers::MEMBERSHIP_ADMINISTRATOR), iaUsers::getTable()) > 0;
}
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:8,代码来源:ia.helper.php
示例2: create
public function create($planId)
{
$entry = array('plan_id' => (int) $planId, 'member_id' => iaUsers::hasIdentity() ? iaUsers::getIdentity()->id : 0, 'status' => self::PENDING);
if ($id = $this->iaDb->insert($entry, array('date_created' => iaDb::FUNCTION_NOW), self::getTable())) {
$entry['id'] = $id;
return $entry;
}
return false;
}
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:9,代码来源:ia.core.subscription.php
示例3: _gridQuery
protected function _gridQuery($columns, $where, $order, $start, $limit)
{
$sql = 'SELECT u.*, IF(u.`id` = 1, 0, u.`id`) `permissions`, u.`id` `config`, IF(u.`system` = 1, 0, 1) `delete` ' . ', IF(u.`id` = 1, 1, p.`access`) `admin` ' . ',(SELECT GROUP_CONCAT(m.`fullname` SEPARATOR \', \') FROM `' . iaUsers::getTable(true) . '` m WHERE m.`usergroup_id` = u.`id` GROUP BY m.`usergroup_id` LIMIT 10) `members` ' . ',(SELECT COUNT(m.`id`) FROM `' . iaUsers::getTable(true) . '` m WHERE m.`usergroup_id` = u.`id` GROUP BY m.`usergroup_id`) `count`' . 'FROM `' . $this->_iaDb->prefix . $this->getTable() . '` u ' . 'LEFT JOIN `' . $this->_iaDb->prefix . 'acl_privileges` p ' . "ON (p.`type` = 'group' " . 'AND p.`type_id` = u.`id` ' . "AND `object` = 'admin_access' " . "AND `action` = 'read' " . ')' . $order . ' ' . 'LIMIT ' . $start . ', ' . $limit;
$usergroups = $this->_iaDb->getAll($sql);
foreach ($usergroups as &$usergroup) {
$usergroup['title'] = iaLanguage::get('usergroup_' . $usergroup['name']);
}
return $usergroups;
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:9,代码来源:usergroups.php
示例4: _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
示例5: _gridQuery
protected function _gridQuery($columns, $where, $order, $start, $limit)
{
foreach (array('amount', 'gateway', 'status') as $joinedColumnName) {
if (false !== stripos($order, $joinedColumnName)) {
$order = str_replace(' i.`', ' t.`', $order);
break;
}
}
$sql = 'SELECT SQL_CALC_FOUND_ROWS ' . 'i.`id`, i.`date_created`, i.`fullname`, ' . 't.`plan_id`, t.`operation`, ' . 't.`status`, CONCAT(t.`amount`, " ", t.`currency`) `amount`, t.`currency`, t.`gateway`, ' . "1 `pdf`, 1 `update`, IF(t.`status` != 'passed', 1, 0) `delete` " . 'FROM `:prefix:table_invoices` i ' . 'LEFT JOIN `:prefix:table_transactions` t ON (t.`id` = i.`transaction_id`) ' . 'LEFT JOIN `:prefix:table_members` m ON (m.`id` = t.`member_id`) ' . ($where ? 'WHERE ' . $where . ' ' : '') . $order . ' ' . 'LIMIT :start, :limit';
$sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'table_invoices' => self::getTable(), 'table_members' => iaUsers::getTable(), 'table_transactions' => 'payment_transactions', 'start' => $start, 'limit' => $limit));
return $this->_iaDb->getAll($sql);
}
开发者ID:rentpad,项目名称:subrion,代码行数:12,代码来源:invoices.php
示例6: getAddress
public function getAddress($transactionId)
{
$invoice = $this->getBy('transaction_id', $transactionId);
if ($invoice && $invoice['address1']) {
return $invoice;
}
// else return an address of the latest populated transaction
$iaTransaction = $this->iaCore->factory('transaction');
$sql = 'SELECT SQL_CALC_FOUND_ROWS i.`address1`, i.`address2`, i.`zip`, i.`country` ' . 'FROM `:prefix:table_transactions` t ' . 'LEFT JOIN `:prefix:table_invoices` i ON (i.`transaction_id` = t.`id`) ' . 'WHERE t.`member_id` = :member AND i.`address1` != "" ' . 'ORDER BY t.`date` DESC ' . 'LIMIT 1';
$sql = iaDb::printf($sql, array('prefix' => $this->iaDb->prefix, 'table_transactions' => $iaTransaction::getTable(), 'table_invoices' => self::getTable(), 'member' => iaUsers::getIdentity()->id));
$row = $this->iaDb->getRow($sql);
return $row ? $row : array('address1' => '', 'address2' => '', 'zip' => '', 'country' => '');
}
开发者ID:UzielSilva,项目名称:subrion,代码行数:13,代码来源:ia.core.invoice.php
示例7: validate
public function validate()
{
if (iaUsers::hasIdentity()) {
return true;
}
$sc1 = isset($_POST['security_code']) ? $_POST['security_code'] : (isset($_GET['security_code']) ? $_GET['security_code'] : '');
$sc2 = $_SESSION['pass'];
$functionName = $this->iaCore->get('captcha_case_sensitive') ? 'strcmp' : 'strcasecmp';
if (empty($_SESSION['pass']) || $functionName($sc1, $sc2) !== 0) {
return false;
}
$_SESSION['pass'] = '';
return true;
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:14,代码来源:ia.front.captcha.php
示例8: _debugInfo
protected function _debugInfo()
{
$iaCore = iaCore::instance();
$iaCore->factory('users');
self::dump(iaCore::ACCESS_FRONT == $iaCore->getAccessType() ? iaCore::FRONT : iaCore::ADMIN, 'Access Type');
self::dump($iaCore->iaView->getParams(), 'Page', 'info');
self::dump($iaCore->iaView->get('action'), 'Action', 'info');
self::dump($iaCore->iaView->get('filename'), 'Module');
self::dump($iaCore->iaView->language, 'Language');
self::dump(iaUsers::hasIdentity() ? iaUsers::getIdentity(true) : null, 'Identity');
self::dump();
// process blocks
$blocks = array();
if ($blocksData = $iaCore->iaView->blocks) {
foreach ($blocksData as $position => $blocksList) {
$blocks[$position] = array();
foreach ($blocksList as $block) {
$blocks[$position][] = $block['name'];
}
}
}
// process constants
$constantsList = get_defined_constants(true);
foreach ($constantsList['user'] as $key => $value) {
if (strpos($key, 'IA_') === 0 && 'IA_SALT' != $key) {
$constants[$key] = $value;
}
}
self::dump($iaCore->requestPath, 'URL Params');
self::dump($blocks, 'Blocks List');
self::dump($iaCore->packagesData, 'Installed Packages');
self::dump($iaCore->getConfig(), 'Configuration Params');
self::dump($constants, 'Constants List');
if (!empty(self::$_data['info'])) {
foreach (self::$_data['info'] as $key => $val) {
self::dump($val, !is_int($key) ? $key : '');
}
}
self::dump();
self::dump($_POST, '$_POST');
self::dump($_FILES, '$_FILES');
self::dump($_GET, '$_GET');
self::dump();
self::dump(PHP_VERSION, 'PHP version');
self::dump($_SERVER, '$_SERVER');
self::dump($_SESSION, '$_SESSION');
self::dump($_COOKIE, '$_COOKIE');
return '[' . $iaCore->iaView->name() . ']';
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:49,代码来源:ia.debug.php
示例9: array
$itemData['password'] = '';
}
} else {
iaField::keepValues($itemData, $fields);
$iaView->setMessages($messages);
}
if (!$error) {
$memberId = $iaUsers->register($itemData);
if ($memberId) {
$iaCore->factory('log')->write(iaLog::ACTION_CREATE, array('item' => 'member', 'name' => $itemData['fullname'], 'id' => $memberId, 'type' => iaCore::FRONT));
}
// process sponsored plan
if ($memberId && isset($_POST['plan_id']) && is_numeric($_POST['plan_id'])) {
$plan = $iaPlan->getById($_POST['plan_id']);
$usergroup = $plan['usergroup'] ? $plan['usergroup'] : iaUsers::MEMBERSHIP_REGULAR;
$iaDb->update(array('id' => $memberId, 'usergroup_id' => $usergroup), 0, 0, iaUsers::getTable());
if ($plan['cost'] > 0) {
$itemData['id'] = $memberId;
$itemData['member_id'] = $memberId;
if ($url = $iaPlan->prePayment($iaUsers->getItemName(), $itemData, $plan['id'])) {
iaUtil::redirect(iaLanguage::get('thanks'), iaLanguage::get('member_created'), $url);
}
}
}
}
} elseif ('register_confirm' == $iaView->name()) {
if (!isset($_GET['email']) || !isset($_GET['key'])) {
return iaView::accessDenied();
}
$error = true;
if ($iaUsers->confirmation($_GET['email'], $_GET['key'])) {
开发者ID:TalehFarzaliey,项目名称:subrion,代码行数:31,代码来源:registration.php
示例10: getAccountDir
public static function getAccountDir($userName = '')
{
if (empty($userName)) {
$userName = iaUsers::hasIdentity() ? iaUsers::getIdentity()->username : false;
}
$serverDirectory = '';
umask(0);
if (empty($userName)) {
$serverDirectory .= '_notregistered' . IA_DS;
if (!is_dir(IA_UPLOADS . $serverDirectory)) {
mkdir(IA_UPLOADS . $serverDirectory);
}
} else {
$subFolders = array();
$subFolders[] = strtolower(substr($userName, 0, 1)) . IA_DS;
$subFolders[] = $userName . IA_DS;
foreach ($subFolders as $folderName) {
$serverDirectory .= $folderName;
is_dir(IA_UPLOADS . $serverDirectory) || mkdir(IA_UPLOADS . $serverDirectory);
}
}
return $serverDirectory;
}
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:23,代码来源:ia.core.util.php
示例11: _resetPage
private function _resetPage(&$iaView)
{
if (isset($_POST['reset'])) {
if ($options = iaUtil::checkPostParam('options', array())) {
if (in_array(iaUsers::getItemName(), $options)) {
$iaUsers = $this->_iaCore->factory('users');
$currentMember = $this->_iaDb->row(iaDb::ALL_COLUMNS_SELECTION, iaDb::convertIds(iaUsers::getIdentity()->id), iaUsers::getTable());
$this->getHelper()->truncate(iaUsers::getTable());
$this->_iaDb->insert($currentMember, null, iaUsers::getTable());
$options = array_diff($options, array($iaUsers->getItemName()));
}
foreach ($options as $option) {
$this->_iaCore->startHook('phpDbControlBeforeReset', array('option' => $option));
}
$this->addMessage('reset_success');
} else {
$this->_error = true;
$this->addMessage('reset_choose_table');
}
} else {
$iaView->setMessages(iaLanguage::get('reset_backup_alert'), iaView::ALERT);
}
$resetOptions = array('members' => iaLanguage::get('reset') . ' ' . iaLanguage::get('members'));
$this->_iaCore->startHook('phpAdminDatabaseBeforeAll', array('reset_options' => &$resetOptions));
$iaView->assign('options', $resetOptions);
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:26,代码来源:database.php
示例12: _setActions
private function _setActions()
{
$result = array();
if (self::REQUEST_HTML != $this->getRequestType()) {
return $result;
}
$iaCore =& $this->iaCore;
if (false !== strpos($iaCore->iaView->name(), 'view')) {
$iaItem = $iaCore->factory('item');
$iaCore->startHook('smartyItemTools');
$iaItem->setItemTools(array('id' => 'action-print', 'title' => iaLanguage::get('print_preview'), 'attributes' => array('href' => '#', 'class' => 'js-print-page')));
$itemData = $iaCore->iaView->iaSmarty->getTemplateVars('item');
if (iaUsers::hasIdentity() && $itemData) {
if (iaUsers::getItemName() != $itemData['item'] && isset($itemData['member_id']) && iaUsers::getIdentity()->id != $itemData['member_id'] || $itemData['item'] == iaUsers::getItemName() && iaUsers::getIdentity()->id != $itemData['id']) {
$isAlreadyFavorited = isset($itemData['favorite']) && $itemData['favorite'] == 1;
$iaItem->setItemTools(array('id' => 'action-favorites', 'title' => iaLanguage::get($isAlreadyFavorited ? 'favorites_action_delete' : 'favorites_action_add'), 'attributes' => array('href' => '#', 'class' => 'js-favorites', 'data-id' => $itemData['id'], 'data-item' => $itemData['item'], 'data-action' => $isAlreadyFavorited ? iaCore::ACTION_DELETE : iaCore::ACTION_ADD)));
}
}
$result = $iaItem->setItemTools();
}
return $result;
}
开发者ID:UzielSilva,项目名称:subrion,代码行数:22,代码来源:ia.core.view.php
示例13: _getItemsStatuses
private function _getItemsStatuses()
{
$result = array();
$iaItem = $this->_iaCore->factory('item');
foreach ($this->_items as $itemName) {
$statuses = array();
$className = ucfirst(substr($itemName, 0, -1));
$itemClassInstance = iaUsers::getItemName() == $itemName ? $this->_iaCore->factory('users') : $this->_iaCore->factoryPackage($className, $iaItem->getPackageByItem($itemName));
if ($itemClassInstance && method_exists($itemClassInstance, 'getStatuses')) {
$statuses = $itemClassInstance->getStatuses();
}
$result[$itemName] = implode(',', $statuses);
}
return $result;
}
开发者ID:kamilklkn,项目名称:subrion,代码行数:15,代码来源:plans.php
示例14: define
* Subrion is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Subrion. If not, see <http://www.gnu.org/licenses/>.
*
*
* @link http://www.subrion.org/
*
******************************************************************************/
define('IA_VER', '330');
$iaOutput->layout()->title = 'Installation Wizard';
$iaOutput->steps = array('check' => 'Pre-Installation Check', 'license' => 'Subrion License', 'configuration' => 'Configuration', 'finish' => 'Script Installation', 'plugins' => 'Plugins Installation');
if (iaHelper::isScriptInstalled() && (!iaUsers::hasIdentity() || iaUsers::MEMBERSHIP_ADMINISTRATOR != iaUsers::getIdentity()->usergroup_id)) {
$iaOutput->errorCode = 'authorization';
return false;
}
$error = false;
$message = '';
$builtinPlugins = array('kcaptcha', 'fancybox', 'personal_blog');
switch ($step) {
case 'check':
$checks = array('server' => array());
$sections = array('server' => array('title' => 'Server Configuration', 'desc' => 'If any of these items are highlighted in red then please take actions to correct them. Failure to do so could lead to your installation not functioning correctly.'), 'recommended' => array('title' => 'Recommended Settings', 'desc' => 'These settings are recommended for PHP in order to ensure full compatibility with Subrion CMS. However, Subrion CMS will still operate if your settings do not quite match the recommended.'), 'directory' => array('title' => 'Directory & File Permissions', 'desc' => 'In order for Subrion CMS to function correctly it needs to be able to access or write to certain files or directories. If you see "Unwritable" you need to change the permissions on the file or directory to allow Subrion CMS to write to it.'));
$checks['server']['mysql_version'] = array('required' => function_exists('mysql_connect'), 'class' => true, 'name' => 'Mysql version', 'value' => function_exists('mysql_connect') ? '<td class="success">' . substr(mysql_get_client_info(), 0, false === ($pos = strpos(mysql_get_client_info(), '-')) ? 10 : $pos) . '</td>' : '<td class="danger">MySQL 5.x or upper required</td>');
$checks['server']['php_version'] = array('required' => version_compare('5.0', PHP_VERSION, '<'), 'class' => true, 'name' => 'PHP version', 'value' => version_compare('5.0', PHP_VERSION, '<') ? '<td class="success">' . PHP_VERSION . '</td>' : '<td class="danger">PHP version is not compatible. PHP 5.x needed. (Current version ' . PHP_VERSION . ')</td>');
$checks['server']['remote'] = array('name' => 'Remote files access support', 'value' => iaHelper::hasAccessToRemote() ? '<td class="success">Available</td>' : '<td class="danger">Unavailable (highly recommended to enable "CURL" extension or "allow_url_fopen")</td>');
$checks['server']['xml'] = array('name' => 'XML support', 'value' => extension_loaded('xml') ? '<td class="success">Available</td>' : '<td class="danger">Unavailable (recommended)</td>');
$checks['server']['mysql_support'] = array('name' => 'MySQL support', 'value' => function_exists('mysql_connect') ? '<td class="success">Available</td>' : '<td class="danger">Unavailable (required)</td>');
开发者ID:nicefirework,项目名称:subrion,代码行数:31,代码来源:module.install.php
示例15: array
$messages = array();
iaCore::util();
if ($fields) {
list($data, $error, $messages, $errorFields) = iaField::parsePost($fields, $item, true);
}
// validate account
if (isset($_POST['account']) && !empty($_POST['account'])) {
$member_id = $iaDb->one('id', "`username` = '{$_POST['account']}' ", iaUsers::getTable());
if (!$member_id) {
$error = true;
$messages[] = iaLanguage::get('album_incorrect_account');
} else {
$data['member_id'] = $member_id;
}
} else {
$data['member_id'] = iaUsers::getIdentity()->id;
}
if (!defined('IA_NOUTF')) {
iaUtf8::loadUTF8Core();
iaUtf8::loadUTF8Util('ascii', 'validation', 'bad', 'utf8_to_ascii');
}
// validate title_alias
$data['title_alias'] = !empty($_POST['title_alias']) ? $_POST['title_alias'] : $_POST['title'];
if (!utf8_is_ascii($data['title_alias'])) {
$data['title_alias'] = utf8_to_ascii($data['title_alias']);
}
$data['title_alias'] = iaSanitize::convertStr($data['title_alias']);
// check for duplicate title_alias in case a new album is added or title_alias has been updated
if (!isset($item['title_alias']) || isset($item['title_alias']) && $data['title_alias'] != $item['title_alias']) {
if ($iaAlbum->existsAlias($data['title_alias'])) {
$error = true;
开发者ID:nicefirework,项目名称:subrion-lyrics,代码行数:31,代码来源:albums.php
示例16: getCustomConfig
/**
* Get the list of user/group specific configuration values
*
* @param null $user user id
* @param null $group group id
*
* @return array
*/
public function getCustomConfig($user = null, $group = null)
{
$local = false;
if (is_null($user) && is_null($group)) {
$this->factory('users');
$local = true;
if (iaUsers::hasIdentity()) {
$user = iaUsers::getIdentity()->id;
$group = iaUsers::getIdentity()->usergroup_id;
} else {
$user = 0;
$group = iaUsers::MEMBERSHIP_GUEST;
}
}
if ($local && !is_null($this->_customConfig)) {
return $this->_customConfig;
}
$result = array();
$stmt = array();
if ($user) {
$stmt[] = "(`type` = 'user' AND `type_id` = {$user}) ";
}
if ($group) {
$stmt[] = "(`type` = 'group' AND `type_id` = {$group}) ";
}
$rows = $this->iaDb->all(array('type', 'name', 'value'), implode(' OR ', $stmt), null, null, self::getCustomConfigTable());
if (empty($rows)) {
return $result;
}
$result = array('group' => array(), 'user' => array(), 'plan' => array());
foreach ($rows as $row) {
$result[$row['type']][$row['name']] = $row['value'];
}
$result = array_merge($result['group'], $result['user'], $result['plan']);
if ($local) {
$this->_customConfig = $result;
}
return $result;
}
开发者ID:UzielSilva,项目名称:subrion,代码行数:47,代码来源:ia.core.php
示例17: ia_print_js
public static function ia_print_js($params, Smarty_Internal_Template &$smarty)
{
$smarty->add_js($params);
if (!isset($params['display'])) {
return '';
}
$iaCore = iaCore::instance();
$resources = self::_arrayCopyKeysSorted($iaCore->iaView->resources->js->toArray());
$output = '';
foreach ($resources as $resource) {
switch (true) {
case strpos($resource, 'code:') === 0:
if ($code = trim(substr($resource, 5))) {
$output .= PHP_EOL . "\t" . '<script type="text/javascript"><!-- ' . PHP_EOL . $code . PHP_EOL . ' --></script>';
}
continue;
case strpos($resource, 'text:') === 0:
if (iaUsers::hasIdentity() && iaCore::ACCESS_ADMIN == iaCore::instance()->getAccessType()) {
$text = trim(substr($resource, 5));
$output .= "<script type=\"text/javascript\">if(document.getElementById('js-ajax-loader-status'))document.getElementById('js-ajax-loader-status').innerHTML = '" . $text . "';</script>" . PHP_EOL;
}
continue;
default:
$output .= PHP_EOL . "\t" . sprintf(self::LINK_SCRIPT_PATTERN, $resource);
}
}
return $output;
}
开发者ID:nicefirework,项目名称:subrion,代码行数:28,代码来源:SmartyPlugins.class.php
示例18: _gridUpdate
protected function _gridUpdate($params)
{
if (isset($params['id']) && is_array($params['id']) && 2 == count($params) && isset($params['status'])) {
$currentUserId = iaUsers::getIdentity()->id;
if (in_array($currentUserId, $params['id'])) {
$totalAdminsCount = (int) $this->_iaDb->one_bind(iaDb::STMT_COUNT_ROWS, '`usergroup_id` = :group AND `status` = :status AND `id` != :id', array('group' => iaUsers::MEMBERSHIP_ADMINISTRATOR, 'status' => iaCore::STATUS_ACTIVE, 'id' => $currentUserId));
if (0 == $totalAdminsCount && $params['status'] != iaCore::STATUS_ACTIVE) {
return array('result' => false, 'message' => iaLanguage::get('action_not_allowed_since_you_only_admin'));
}
}
}
return parent::_gridUpdate($params);
}
开发者ID:nicefirework,项目名称:subrion,代码行数:13,代码来源:members.php
示例19: array
if (empty($member)) {
$member = $iaUsers->getInfo((int) $iaCore->requestPath[0]);
}
if (empty($member)) {
return iaView::errorPage(iaView::ERROR_NOT_FOUND);
}
$iaCore->factory('util');
$iaPage = $iaCore->factory('page', iaCore::FRONT);
$member['item'] = $iaUsers->getItemName();
$iaCore->startHook('phpViewListingBeforeStart', array('listing' => $member['id'], 'item' => $member['item'], 'title' => $member['fullname'], 'url' => $iaView->iaSmarty->ia_url(array('data' => $member, 'item' => $member['item'], 'type' => 'url')), 'desc' => $member['fullname']));
$iaItem = $iaCore->factory('item');
$iaCore->set('num_items_perpage', 20);
$page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
$page = $page < 1 ? 1 : $page;
$start = ($page - 1) * $iaCore->get('num_items_perpage');
if (iaUsers::hasIdentity() && iaUsers::getIdentity()->id == $member['id']) {
$iaItem->setItemTools(array('title' => iaLanguage::get('edit'), 'url' => $iaPage->getUrlByName('profile')));
}
$member = array_shift($iaItem->updateItemsFavorites(array($member), $member['item']));
$member['items'] = array();
// get fieldgroups
$iaField = $iaCore->factory('field');
list($sections, ) = $iaField->generateTabs($iaField->filterByGroup($member, $member['item']));
// get all items added by this account
$itemsList = $iaItem->getPackageItems();
$itemsFlat = array();
if ($array = $iaItem->getItemsInfo(true)) {
foreach ($array as $itemData) {
if ($itemData['item'] != $member['item'] && $iaItem->isExtrasExist($itemsList[$itemData['item']])) {
$itemsFlat[] = $itemData['item'];
}
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:31,代码来源:view_member.php
示例20: createInvoice
/**
* Generates invoice for an item
*
* @param string $title plan title
* @param double $cost plan cost
* @param string $itemName item name
* @param array $itemData item details
* @param string $returnUrl return URL
* @param int $planId plan id
* @param bool $return true redirects to invoice payment URL
*
* @return string
*/
public function createInvoice($title, $cost, $itemName = 'members', $itemData = array(), $returnUrl = '', $planId = 0, $return = false)
{
if (!isset($itemData['id'])) {
$itemData['id'] = 0;
}
$title = empty($title) ? iaLanguage::get('plan_title_' . $planId) : $title;
$title .= $itemData['id'] ? ' - #' . $itemData['id'] : '';
$transactionId = uniqid('t');
$transaction = array('member_id' => (int) (isset($itemData['member_id']) && $itemData['member_id'] ? $itemData['member_id'] : iaUsers::getIdentity()->id), 'item' => $itemName, 'item_id' => $itemData['id'], 'amount' => $cost, 'currency' => $this->iaCore->get('currency'), 'sec_key' => $transactionId, 'status' => self::PENDING, 'plan_id' => $planId, 'return_url' => $returnUrl, 'operation' => $title, 'date' => date(iaDb::DATETIME_FORMAT));
$result = (bool) $this->iaDb->insert($transaction, null, $this->getTable());
$return || iaUtil::go_to(IA_URL . 'pay' . IA_URL_DELIMITER . $transactionId . IA_URL_DELIMITER);
return $result ? $transactionId : false;
}
开发者ID:bohmszi,项目名称:kdbe_cms,代码行数:26,代码来源:ia.core.transaction.php
注:本文中的iaUsers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论