本文整理汇总了PHP中xoonips_getormhandler函数的典型用法代码示例。如果您正苦于以下问题:PHP xoonips_getormhandler函数的具体用法?PHP xoonips_getormhandler怎么用?PHP xoonips_getormhandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoonips_getormhandler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_xoonips_item_template_vars
function get_xoonips_item_template_vars()
{
$basic =& $this->_params['item']->getVar('basic');
$result = array('basic' => array('item_id' => $basic->get('item_id'), 'description' => $basic->getVar('description', 's'), 'doi' => $basic->get('doi'), 'creation_date' => $basic->get('creation_date'), 'last_update_date' => $basic->get('last_update_date'), 'publication_year' => $basic->get('publication_year'), 'publication_month' => $basic->get('publication_month'), 'publication_mday' => $basic->get('publication_mday'), 'lang' => $this->get_lang_label()), 'title' => array(), 'keyword' => array(), 'changelog' => array(), 'index_item_link' => array(), 'related_tos' => array());
foreach ($this->_params['item']->getVar('titles') as $title) {
$result['title'][] = array('title' => $title->getVar('title', 's'));
}
foreach ($this->_params['item']->getVar('keywords') as $keyword) {
$result['keyword'][] = array('keyword' => $keyword->getVar('keyword', 's'));
}
foreach ($this->_params['item']->getVar('changelogs') as $changelog) {
$result['changelog'][] = array('log_date' => $changelog->get('log_date'), 'log' => $changelog->getVar('log', 's'));
}
foreach ($this->_params['item']->getVar('indexes') as $link) {
$result['index_item_link'][] = array('path' => $this->get_index_path_by_index_id($link->get('index_id')), 's');
}
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
$basic_handler =& xoonips_getormhandler('xoonips', 'item_basic');
foreach ($this->_params['item']->getVar('related_tos') as $related_to) {
$related_basic =& $basic_handler->get($related_to->get('item_id'));
$related_item_type =& $item_type_handler->get($related_basic->get('item_type_id'));
$item_compo_handler =& xoonips_getormcompohandler($related_item_type->get('name'), 'item');
$result['related_tos'][] = array('filename' => 'db:' . $item_compo_handler->getTemplateFileName(XOONIPS_TEMPLATE_TYPE_TRANSFER_ITEM_LIST), 'var' => $item_compo_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_TRANSFER_ITEM_LIST, $related_basic->get('item_id')));
}
return $result;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:26,代码来源:transfer_user_requested_item_detail.class.php
示例2: postAction
function postAction()
{
global $xoopsUser;
if (!$this->_response->getResult()) {
foreach ($this->_collection->getItems() as $item) {
foreach ($item->getErrorCodes() as $code) {
if ($code != E_XOONIPS_UPDATE_CERTIFY_REQUEST_LOCKED) {
continue;
}
$titles =& $item->getVar('titles');
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
redirect_header(XOOPS_URL . '/modules/xoonips/import.php?action=default', 5, sprintf(_MD_XOONIPS_ERROR_CANNOT_OVERWRITE_LOCKED_ITEM, $titles[0]->get('title'), xoonips_get_lock_type_string($item_lock_handler->getLockType($item->getUpdateItemId()))));
}
}
}
$this->_finish_time = time();
$success =& $this->_response->getSuccess();
$this->_view_params['result'] = $this->_response->getResult();
$this->_view_params['import_items'] = $success['import_items'];
$this->_view_params['begin_time'] = $this->_begin_time;
$this->_view_params['finish_time'] = $this->_finish_time;
$this->_view_params['filename'] = $this->_collection->getImportFileName();
$this->_view_params['uname'] = $xoopsUser->getVar('uname');
$this->_view_params['errors'] = array();
foreach ($success['import_items'] as $item) {
foreach (array_unique($item->getErrorCodes()) as $code) {
$this->_view_params['errors'][] = array('code' => $code, 'extra' => $item->getPseudoId());
}
}
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:30,代码来源:import_import.class.php
示例3: xoonips_admin_maintenance_item_unlock_item
/**
*
* @brief unlock item
*
* @param[in] $item_id item id
*/
function xoonips_admin_maintenance_item_unlock_item($item_id)
{
// unlock item
$index_handler =& xoonips_getormhandler('xoonips', 'index');
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
$item_basic_handler =& xoonips_getormhandler('xoonips', 'item_basic');
$index_item_link_handler =& xoonips_getormhandler('xoonips', 'index_item_link');
$event_log_handler =& xoonips_getormhandler('xoonips', 'event_log');
if ($item_lock_handler->isLocked($item_id)) {
$lock_type = $item_lock_handler->getLockType($item_id);
if ($lock_type == XOONIPS_LOCK_TYPE_CERTIFY_REQUEST) {
$index_item_links =& $index_item_link_handler->getObjects(new Criteria('item_id', $item_id));
foreach ($index_item_links as $index_item_link) {
if ($index_item_link->get('certify_state') == CERTIFY_REQUIRED) {
$index_id = $index_item_link->get('index_id');
$index = $index_handler->get($index_id);
if ($index->getVar('open_level', 'n') == OL_PUBLIC || $index->getVar('open_level', 'n') == OL_GROUP_ONLY) {
$item_basic_handler->unlockItemAndIndexes($item_id, $index_id);
$event_log_handler->recordRejectItemEvent($item_id, $index_id);
$index_item_link_handler->delete($index_item_link);
xoonips_notification_item_rejected($item_id, $index_id);
}
}
}
} else {
// TODO: unlock if transfer request
}
}
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:35,代码来源:maintenance_item_dupdate.php
示例4: xoonips_getormhandler
/**
* return XooNIpsXmlRpcItemView corresponding to $logic and $item(itemtype)
*
* @param string $logic logic name
* @param XooNIpsItemCompo item object
* @retval XooNIpsXmlRpcItemViewElement corresponding to $logic
* @retval false unknown logic or unknown item
*/
function &create($logic, &$item)
{
static $falseVar = false;
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
$basic =& $item->getVar('basic');
$itemtype =& $item_type_handler->get($basic->get('item_type_id'));
if (!$itemtype) {
return $falseVar;
}
//
$name = $itemtype->get('name');
//
$include_file = XOOPS_ROOT_PATH . "/modules/{$name}/class/xmlrpc/view/" . strtolower($logic) . ".class.php";
if (file_exists($include_file)) {
include_once $include_file;
} else {
return $falseVar;
}
//
if (strncmp('xnp', $name, 3) == 0) {
$tok = substr($name, 3);
$class = 'XNP' . ucfirst($tok) . 'XmlRpcItemView' . ucfirst($logic);
$ret = new $class($item);
return $ret;
}
return $falseVar;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:35,代码来源:xmlrpcviewfactory.class.php
示例5: item_get_userlist
function item_get_userlist($upage)
{
global $xoopsDB;
global $xoopsUser;
// myuid
$myuid = $xoopsUser->getVar('uid', 'n');
$xusers_handler =& xoonips_getormhandler('xoonips', 'users');
$tables['users'] = $xoopsDB->prefix('users');
$tables['xusers'] = $xoopsDB->prefix('xoonips_users');
$join_criteria = new XooNIpsJoinCriteria('users', 'uid', 'uid');
$criteria = new Criteria($tables['users'] . '.level', 0, '>');
$criteria->setSort($tables['users'] . '.uname');
$fields = array();
$fields[] = $tables['xusers'] . '.uid';
$fields[] = $tables['users'] . '.uname';
$xusers_objs =& $xusers_handler->getObjects($criteria, false, implode(',', $fields), false, $join_criteria);
$textutil =& xoonips_getutility('text');
$users = array();
$users[] = array('uid' => 0, 'uname' => $textutil->html_special_chars(_AM_XOONIPS_MAINTENANCE_ITEM_LABEL_ALLUSERS), 'selected' => 'selected="selected"');
foreach ($xusers_objs as $xusers_obj) {
$uid = $xusers_obj->getVar('uid', 'e');
$uname = $textutil->html_special_chars($xusers_obj->getExtraVar('uname'));
$users[] = array('uid' => $uid, 'uname' => $uname, 'selected' => '');
}
return $users;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:26,代码来源:maintenance_item_uselect.php
示例6: execute_without_transaction
/**
* transfer request
*
* @param[in] $vars[0] array of item_id
* @param[in] $vars[1] uid of old item owner
* @param[in] $vars[2] uid of new item owner
* @param[out] XooNIpsError error
* @return bool true if succeeded
*/
function execute_without_transaction(&$vars, &$error)
{
$item_ids = $vars[0];
$from_uid = $vars[1];
$to_uid = $vars[2];
if (false == xoonips_transfer_is_transferrable($from_uid, $to_uid, $item_ids)) {
$error->add(XNPERR_SERVER_ERROR, "not transferrable");
return false;
}
foreach ($item_ids as $item_id) {
$transfer_request_handler =& xoonips_getormhandler('xoonips', 'transfer_request');
$transfer_request = $transfer_request_handler->create();
$transfer_request->set('item_id', $item_id);
$transfer_request->set('to_uid', $to_uid);
if (false == $transfer_request_handler->insert($transfer_request)) {
$error->add(XNPERR_SERVER_ERROR, "cannot insert tranfer_request");
return false;
}
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
if (false == $item_lock_handler->lock($item_id)) {
$error->add(XNPERR_SERVER_ERROR, "cannot lock item");
return false;
}
$eventlog_handler =& xoonips_getormhandler('xoonips', 'event_log');
if (false == $eventlog_handler->recordRequestTransferItemEvent($item_id, $to_uid)) {
$error->add(XNPERR_SERVER_ERROR, "cannot insert evnet log");
return false;
}
}
return true;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:40,代码来源:transferuserrequest.class.php
示例7: userCheck
function userCheck($uname, $email, $pass, $vpass)
{
global $myxoopsConfigUser;
$xoopsDB =& Database::getInstance();
$stop = '';
if (!checkEmail($email)) {
$stop .= _US_INVALIDMAIL . '<br />';
}
foreach ($myxoopsConfigUser['bad_emails'] as $be) {
if (!empty($be) && preg_match('/' . $be . '/i', $email)) {
$stop .= _US_INVALIDMAIL . '<br />';
break;
}
}
if (strrpos($email, ' ') > 0) {
$stop .= _US_EMAILNOSPACES . '<br />';
}
$uname = xoops_trim($uname);
$restrictions = array(0 => '/[^a-zA-Z0-9\\_\\-]/', 1 => '/[^a-zA-Z0-9\\_\\-\\<\\>\\,\\.\\$\\%\\#\\@\\!\\\'\\"]/', 2 => '/[\\000-\\040]/');
$restriction = $restrictions[$myxoopsConfigUser['uname_test_level']];
if (empty($uname) || preg_match($restriction, $uname)) {
$stop .= _US_INVALIDNICKNAME . '<br />';
}
if (strlen($uname) > $myxoopsConfigUser['maxuname']) {
$stop .= sprintf(_US_NICKNAMETOOLONG, $myxoopsConfigUser['maxuname']) . '<br />';
}
if (strlen($uname) < $myxoopsConfigUser['minuname']) {
$stop .= sprintf(_US_NICKNAMETOOSHORT, $myxoopsConfigUser['minuname']) . '<br />';
}
foreach ($myxoopsConfigUser['bad_unames'] as $bu) {
if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) {
$stop .= _US_NAMERESERVED . '<br />';
break;
}
}
if (strrpos($uname, ' ') > 0) {
$stop .= _US_NICKNAMENOSPACES . '<br />';
}
$u_handler =& xoonips_getormhandler('xoonips', 'xoops_users');
$criteria = new Criteria('uname', addslashes($uname));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_NICKNAMETAKEN . "<br />";
}
if ($email) {
$criteria = new Criteria('email', addslashes($email));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_EMAILTAKEN . "<br />";
}
}
if (!isset($pass) || $pass == '' || !isset($vpass) || $vpass == '') {
$stop .= _US_ENTERPWD . '<br />';
}
if (isset($pass) && $pass != $vpass) {
$stop .= _US_PASSNOTSAME . '<br />';
} elseif ($pass != '' && strlen($pass) < $myxoopsConfigUser['minpass']) {
$stop .= sprintf(_US_PWDTOOSHORT, $myxoopsConfigUser['minpass']) . '<br />';
}
return $stop;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:59,代码来源:registeruser.php
示例8: XooNIpsUtilityFile
/**
* constructor
*
* @access public
*/
function XooNIpsUtilityFile()
{
$this->setSingleton();
$xconfig_handler =& xoonips_getormhandler('xoonips', 'config');
$this->magic_file_path = $xconfig_handler->getValue('magic_file_path');
// append additional mimetype mapping
$this->mimetype_map['application/zip'] = $this->mimetype_map['application/x-zip'];
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:13,代码来源:file.class.php
示例9: XooNIpsFileHandler
/**
* constractor
*
* @access public
*/
function XooNIpsFileHandler()
{
$this->xf_handler =& xoonips_getormhandler('xoonips', 'file');
$this->xst_handler =& xoonips_getormhandler('xoonips', 'search_text');
$xc_handler =& xoonips_getormhandler('xoonips', 'config');
$this->upload_dir = $xc_handler->getValue('upload_dir');
if (strlen($this->upload_dir) > 1 && substr($this->upload_dir, -1) == '/') {
$this->upload_dir = substr($this->upload_dir, 0, strlen($this->upload_dir) - 1);
}
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:xoonips_file.class.php
示例10: _getItemTitle
function _getItemTitle($item_id, $fmt)
{
$it_handler =& xoonips_getormhandler('xoonips', 'title');
$title = '';
$tobjs = $it_handler->getTitles($item_id);
foreach ($tobjs as $tobj) {
$title .= $tobj->get('title', $fmt);
}
return $title;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:10,代码来源:Backend.class.php
示例11: getCreators
/**
* get creator objects of this item
* @return XNPConferenceOrmCreator[]
*/
function getCreators()
{
$handler =& xoonips_getormhandler('xnpmodel', 'creator');
$criteria = new Criteria('model_id', $this->get('model_id'));
$criteria->setSort('creator_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php
示例12: _remove_files
/**
* remove all deleted(is_deleted=1) files from file system
*/
function _remove_files()
{
$handler =& xoonips_getormhandler('xoonips', 'file');
$criteria = new Criteria('is_deleted', 1);
$delete_files =& $handler->getObjects($criteria);
if ($delete_files) {
foreach ($delete_files as $file) {
$handler->deleteFile($file);
}
}
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:14,代码来源:importimport.class.php
示例13: getAuthors
/**
* get author objects of this item
* @return XNPPaperOrmAuthor[]
*/
function getAuthors()
{
$handler =& xoonips_getormhandler('xnppaper', 'author');
$criteria = new Criteria('paper_id', $this->get('paper_id'));
$criteria->setSort('author_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php
示例14: _get_result_log
function _get_result_log()
{
$log = '';
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
foreach ($this->_params['import_items'] as $item) {
foreach (array_unique($item->getErrorCodes()) as $code) {
$log .= "\nerror " . $code . " " . $item->getVar('pseudo_id');
}
}
return $log;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:11,代码来源:import_log.class.php
示例15: getDevelopers
/**
* get developer objects of this item
* @return XnpstimulusOrmDeveloper[]
*/
function getDevelopers()
{
$handler =& xoonips_getormhandler('xnpstimulus', 'developer');
$criteria = new Criteria('stimulus_id', $this->get('stimulus_id'));
$criteria->setSort('developer_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php
示例16: execute
/**
* execute getItemtypes
*
* @param[in] $vars[0] session ID
* @param[out] $response->result true:success, false:failed
* @param[out] $response->error error information
* @param[out] $response->success array of item type structure
*/
function execute(&$vars, &$response)
{
// parameter check
$error =& $response->getError();
if (count($vars) > 1) {
$error->add(XNPERR_EXTRA_PARAM);
}
if (count($vars) < 1) {
$error->add(XNPERR_MISSING_PARAM);
}
//
if (isset($vars[0]) && strlen($vars[0]) > 32) {
$error->add(XNPERR_INVALID_PARAM, 'too long parameter 1');
}
//
if ($error->get(0)) {
// return if parameter error
$response->setResult(false);
return;
} else {
$response->setResult(false);
$sessionid = $vars[0];
}
list($result, $uid, $session) = $this->restoreSession($sessionid);
if (!$result) {
$response->setResult(false);
$error->add(XNPERR_INVALID_SESSION);
return false;
}
//
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
$item_types =& $item_type_handler->getObjects();
if (!$item_types) {
$response->setResult(false);
$error->add(XNPERR_SERVER_ERROR, "cannot get itemtypes");
return false;
}
$result = array();
foreach ($item_types as $item_type) {
$item_type_name = $item_type->get('name');
$detail_item_type_handler =& xoonips_getormhandler($item_type_name, 'item_type');
if (!$detail_item_type_handler) {
continue;
}
$detail_item_type = $detail_item_type_handler->get($item_type->get('item_type_id'));
if (!$detail_item_type) {
continue;
}
$result[] = $detail_item_type;
}
$response->setSuccess($result);
$response->setResult(true);
return true;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:62,代码来源:getitemtypes.class.php
示例17: getExperimenters
/**
* get experimenter objects of this item
* @return XNPDataOrmExperimenter[]
*/
function getExperimenters()
{
$handler =& xoonips_getormhandler('xnpdata', 'experimenter');
$criteria = new Criteria('data_id', $this->get('data_id'));
$criteria->setSort('experimenter_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php
示例18: b_xoonips_moderator_show
function b_xoonips_moderator_show()
{
global $xoopsUser;
// hide block if user is guest
if (!is_object($xoopsUser)) {
return false;
}
$uid = $xoopsUser->getVar('uid', 'n');
// hide block if user is invalid xoonips user
$xsession_handler =& xoonips_getormhandler('xoonips', 'session');
if (!$xsession_handler->validateUser($uid, false)) {
return false;
}
// check moderator user
$xmember_handler =& xoonips_gethandler('xoonips', 'member');
if (!$xmember_handler->isModerator($uid)) {
// user is not moderator
return false;
}
// count certification requested users
$xu_ohandler =& xoonips_getormhandler('xoonips', 'users');
$join = new XooNIpsJoinCriteria('users', 'uid', 'uid', 'INNER', 'u');
$criteria = new CriteriaCompo(new Criteria('activate', 0));
$criteria->add(new Criteria('level', 0, '>', 'u'));
$cu_count = $xu_ohandler->getCount($criteria, $join);
// count certification requested items
$xil_handler =& xoonips_getormhandler('xoonips', 'index_item_link');
$join = new XooNIpsJoinCriteria('xoonips_index', 'index_id', 'index_id', 'INNER', 'x');
$criteria = new CriteriaCompo(new Criteria('certify_state', CERTIFY_REQUIRED));
$criteria->add(new Criteria('open_level', OL_PUBLIC, '=', 'x'));
$ci_count = $xil_handler->getCount($criteria, $join);
// count group items open to public certification requested indexes
if (xoonips_get_version() >= 340) {
$xgxl_handler =& xoonips_getormhandler('xoonips', 'index_group_index_link');
$gi_count = $xgxl_handler->getCount();
} else {
$gi_count = 0;
}
// assign block template variables
$block = array();
$block['lang_edit_group'] = _MB_XOONIPS_MODERATOR_EDIT_GROUPS;
$block['lang_certify_users'] = _MB_XOONIPS_MODERATOR_CERTIFY_USERS;
$block['lang_certify_users_count'] = $cu_count;
$block['lang_certify_items'] = _MB_XOONIPS_MODERATOR_CERTIFY_PUBLIC_ITEMS;
$block['lang_certify_items_count'] = $ci_count;
$block['lang_groupcertify_items'] = _MB_XOONIPS_MODERATOR_GROUP_CERTIFY_PUBLIC_ITEMS;
$block['lang_groupcertify_items_count'] = $gi_count;
$block['lang_edit_public_index'] = _MB_XOONIPS_MODERATOR_EDIT_PUBLIC_INDEX;
$block['lang_event_log'] = _MB_XOONIPS_MODERATOR_EVENT_LOG;
$block['xid'] = IID_PUBLIC;
return $block;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:52,代码来源:xoonips_moderator.php
示例19: get_transfer_request_item_ids
/**
*
* get array of item id to transfer to user($uid)
*
* @param integer $uid transferee's uid
* @return array integer array of item id to be transfered
*/
function get_transfer_request_item_ids($uid)
{
$transfer_handler =& xoonips_getormhandler('xoonips', 'transfer_request');
$transfers =& $transfer_handler->getObjects(new Criteria('to_uid', $uid));
if (false === $transfers) {
return array();
}
$result = array();
foreach ($transfers as $t) {
$result[] = $t->get('item_id');
}
return $result;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:20,代码来源:transfer_user_list_item.class.php
示例20: execute
/**
* execute getIndex
*
* @param[in] $vars[0] session ID
* @param[in] $vars[1] index ID
* @param[out] $response->result true:success, false:failed
* @param[out] $response->error error information
* @param[out] $response->success XooNIpsIndexCompo index information
*/
function execute(&$vars, &$response)
{
// parameter check
$error =& $response->getError();
if (count($vars) > 2) {
$error->add(XNPERR_EXTRA_PARAM);
} else {
if (count($vars) < 2) {
$error->add(XNPERR_MISSING_PARAM);
} else {
if (isset($vars[0]) && strlen($vars[0]) > 32) {
$error->add(XNPERR_INVALID_PARAM, 'too long parameter 1');
}
if (!is_int($vars[1]) && !ctype_digit($vars[1])) {
$error->add(XNPERR_INVALID_PARAM, 'not integer parameter 2');
}
}
}
if ($error->get(0)) {
// return if parameter error
$response->setResult(false);
return;
} else {
$sessionid = $vars[0];
$index_id = $vars[1];
}
list($result, $uid, $session) = $this->restoreSession($sessionid);
if (!$result) {
$response->setResult(false);
$error->add(XNPERR_INVALID_SESSION);
return false;
}
// get index from index_id
$index_compo_handler =& xoonips_getormcompohandler('xoonips', 'index');
$index = $index_compo_handler->get($index_id);
if ($index == false) {
$response->setResult(false);
$response->error->add(XNPERR_NOT_FOUND, "cannot get index");
return false;
}
// check permission
$index_handler =& xoonips_getormhandler('xoonips', 'index');
if (!$index_handler->getPerm($index_id, $uid, 'read')) {
$response->setResult(false);
$response->error->add(XNPERR_ACCESS_FORBIDDEN, "no permission");
return false;
}
$response->setSuccess($index);
$response->setResult(true);
return true;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:60,代码来源:getindex.class.php
注:本文中的xoonips_getormhandler函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论