本文整理汇总了PHP中Phpfox_Error类 的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox_Error类的具体用法?PHP Phpfox_Error怎么用?PHP Phpfox_Error使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Phpfox_Error类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if (isset($_POST['token']) && strlen($_POST['token']) == 40) {
$aPost = array('token' => $_POST['token'], 'apiKey' => Phpfox::getParam('janrain.janrain_api_key'), 'format' => 'json', 'extended' => 'true');
$sResult = Phpfox::getLib('request')->send('https://rpxnow.com/api/v2/auth_info', $aPost);
$aInfo = json_decode($sResult, true);
if ($aInfo['stat'] == 'ok') {
$aUserInfo = $aInfo['profile'];
if ($aUser = Phpfox::getService('janrain')->getUser($aUserInfo)) {
list($bIsLoggedIn, $aPostUserInfo) = Phpfox::getService('user.auth')->login($aUser['user_name'], null, false, 'user_name', true);
if ($bIsLoggedIn) {
$this->url()->send(Phpfox::getParam('user.redirect_after_login'));
}
} else {
if (Phpfox::getService('janrain.process')->add($aUserInfo)) {
$aUser = Phpfox::getService('janrain')->getUser($aUserInfo);
if ($sPlugin = Phpfox_Plugin::get('janrain.component_controller_rpx_1')) {
eval($sPlugin);
if (isset($mReturnFromPlugin)) {
return $mReturnFromPlugin;
}
}
list($bIsLoggedIn, $aPostUserInfo) = Phpfox::getService('user.auth')->login($aUser['user_name'], null, false, 'user_name', true);
if ($bIsLoggedIn) {
$this->url()->send('user.setting', null, Phpfox::getPhrase('janrain.your_account_has_successfully_been_created_please_enter_your_account_details_below'));
}
}
}
} else {
Phpfox_Error::set($aInfo['err']['msg']);
}
} else {
Phpfox_Error::set('Authentication canceled.');
}
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:38, 代码来源:rpx.class.php
示例2: process
/**
* Controller
*/
public function process()
{
if ($iCommentId = $this->request()->getInt('req3')) {
$aComment = Phpfox::getService('comment')->getComment($iCommentId);
if (!isset($aComment['comment_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
}
if (Phpfox::hasCallback('comment', 'getRedirectRequest')) {
$this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
}
if (Phpfox::hasCallback($aComment['type_id'], 'getParentItemCommentUrl')) {
$sNewUrl = Phpfox::callback($aComment['type_id'] . '.getParentItemCommentUrl', $aComment);
if ($sNewUrl !== false) {
$aComment['callback_url'] = $sNewUrl;
}
}
$this->template()->setTitle(Phpfox::getPhrase('comment.viewing_comment'))->setHeader(array('view.css' => 'module_comment'))->setBreadcrumb(Phpfox::getPhrase('comment.viewing_comment'))->assign(array('aComment' => $aComment));
} else {
$aComment = Phpfox::getService('comment')->getComment($this->request()->getInt('id'));
if (!isset($aComment['comment_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('comment.comment_does_not_exist'));
}
$this->url()->forward(Phpfox::callback('comment.getRedirectRequest', $aComment['comment_id']));
}
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:28, 代码来源:view.class.php
示例3: __get
/**
* Gets a param that is part of this component group.
*
* @param string $sData Param name.
* @return mixed If param exists we return the param value otherwise we return NULL.
*/
public function __get($sData)
{
if (isset(self::$_aParams[$this->_sCacheVar][$sData])) {
return self::$_aParams[$this->_sCacheVar][$sData];
}
Phpfox_Error::trigger('Undefined property: ' . $sData, E_USER_ERROR);
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:13, 代码来源:component.class.php
示例4: process
/**
* Controller
*/
public function process()
{
$this->_setMenuName('admincp.user.cancellations.add');
// is user trying to edit or add an item?
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('user.cancellations.process')->add($aVals)) {
if (isset($aVals['iDeleteId'])) {
$sMessage = Phpfox::getPhrase('user.option_updated_successfully');
} else {
$sMessage = Phpfox::getPhrase('user.option_added_successfully');
}
$this->url()->send('admincp.user.cancellations.manage', null, $sMessage);
}
}
// is user requesting an item for edit?
if ($iId = $this->request()->getInt('id')) {
$aDelete = Phpfox::getService('user.cancellations')->get($iId);
if (empty($aDelete)) {
Phpfox_Error::set(Phpfox::getPhrase('user.item_not_found'));
}
$aDelete = reset($aDelete);
$this->template()->assign(array('aForms' => $aDelete));
}
$this->template()->setTitle(Phpfox::getPhrase('user.add_cancellation_options'))->setBreadcrumb(Phpfox::getPhrase('user.add_cancellation_options'), $this->url()->makeUrl('admincp.user.cancellations.add'), true)->assign(array());
}
开发者ID:lev1976g, 项目名称:core, 代码行数:28, 代码来源:add.class.php
示例5: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
if ($aVals = $this->request()->getArray('val')) {
Phpfox::isUser(true);
Phpfox::getUserParam('comment.can_post_comments', true);
if (($iFlood = Phpfox::getUserParam('comment.comment_post_flood_control')) !== 0) {
$aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('comment'), 'condition' => 'type_id = \'' . Phpfox::getLib('database')->escape($aVals['type']) . '\' AND user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60));
// actually check if flooding
if (Phpfox::getLib('spam')->check($aFlood)) {
Phpfox_Error::set(Phpfox::getPhrase('comment.posting_a_comment_a_little_too_soon_total_time', array('total_time' => Phpfox::getLib('spam')->getWaitTime())));
}
}
if (Phpfox::getLib('parse.format')->isEmpty($aVals['text'])) {
Phpfox_Error::set(Phpfox::getPhrase('feed.add_some_text_to_your_comment'));
}
if (Phpfox_Error::isPassed() && ($iId = Phpfox::getService('comment.process')->add($aVals))) {
$this->url()->send('feed.view', array('id' => $this->request()->getInt('id')), Phpfox::getPhrase('feed.successfully_added_your_comment'));
}
}
if ($iLikeType = $this->request()->getInt('liketype')) {
if (Phpfox::getService('feed.process')->like($this->request()->getInt('id'), $iLikeType)) {
$this->url()->send('feed.view', array('id' => $this->request()->getInt('id')), $iLikeType == '1' ? Phpfox::getPhrase('feed.successfully_liked_this_feed') : Phpfox::getPhrase('feed.successfully_unliked_this_feed'));
}
}
list($iFeedCount, $aFeeds) = Phpfox::getService('feed')->get(null, $this->request()->getInt('id'), 1);
$iCommentCnt = 0;
$aComments = array();
if (Phpfox::getParam('feed.allow_comments_on_feeds')) {
list($iCommentCnt, $aComments) = Phpfox::getService('comment')->get('cmt.*', array("AND cmt.type_id = 'feed'", 'AND cmt.item_id = ' . (int) $aFeeds[0]['feed_id'], 'AND cmt.view_id = 0'), 'cmt.time_stamp ASC');
}
if (!count($aFeeds)) {
return Phpfox_Error::display(Phpfox::getPhrase('feed.not_a_valid_feed'));
}
$this->template()->setMobileHeader(array('feed.css' => 'module_feed'))->assign(array('iFeedId' => $aFeeds[0]['feed_id'], 'aFeeds' => $aFeeds, 'aComments' => $aComments));
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:38, 代码来源:view-mobile.class.php
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
$aValidation = array('name' => Phpfox::getPhrase('photo.provide_a_name_for_your_photo_category'));
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));
if (($aOrder = $this->request()->getArray('order')) && Phpfox::getUserParam('photo.can_edit_photo_categories', true) && Phpfox::getService('photo.category.process')->updateOrder($aOrder)) {
$this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_order_successfully_updated'));
}
if (!Phpfox::getUserParam('photo.can_add_public_categories') && !Phpfox::getUserParam('photo.can_edit_photo_categories')) {
return Phpfox_Error::display(Phpfox::getPhrase('photo.invalid_section'));
}
if ($aVals = $this->request()->getArray('val')) {
if ($oValid->isValid($aVals)) {
if (isset($aVals['delete']) && Phpfox::getUserParam('photo.can_edit_photo_categories', true)) {
if (Phpfox::getService('photo.category.process')->delete($aVals['edit_id'])) {
$this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_deleted'));
}
} else {
if (isset($aVals['edit_id'])) {
Phpfox::getUserParam('photo.can_edit_photo_categories', true);
if (Phpfox::getService('photo.category.process')->update($aVals)) {
$this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_updated'));
}
} else {
Phpfox::getUserParam('photo.can_add_public_categories', true);
if (Phpfox::getService('photo.category.process')->add($aVals)) {
$this->url()->send('admincp.photo', null, Phpfox::getPhrase('photo.photo_category_successfully_added'));
}
}
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('photo.manage_photo_categories'))->setBreadCrumb(Phpfox::getPhrase('photo.manage_photo_categories'), $this->url()->makeUrl('admincp.photo'))->setHeader('cache', array('admin.js' => 'module_photo', 'jquery/ui.js' => 'static_script', 'sort.js' => 'module_photo'))->assign(array('sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm()));
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:36, 代码来源:index.class.php
示例7: process
public function process()
{
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('custom.relation.process')->add($aVals)) {
$this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_added'));
}
}
if ($iId = $this->request()->getInt('delete')) {
if (Phpfox::getService('custom.relation.process')->delete($iId)) {
$this->url()->send('admincp.custom.relationships', array(), Phpfox::getPhrase('custom.status_deleted'));
}
}
$aStatuses = Phpfox::getService('custom.relation')->getAll();
/* If we're editing lets make it easier and just find the one we're looking for here */
if ($iEdit = $this->request()->getInt('edit')) {
$aEdit = array();
foreach ($aStatuses as $aStatus) {
if ($aStatus['relation_id'] == $iEdit) {
$aEdit = $aStatus;
break;
}
}
if (empty($aEdit)) {
Phpfox_Error::display(Phpfox::getPhrase('custom.not_found'));
} else {
$this->template()->assign(array('aEdit' => $aEdit));
}
}
$this->template()->setTitle(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setBreadcrumb(Phpfox::getPhrase('custom.admin_menu_manage_relationships'))->setPhrase(array())->assign(array('aStatuses' => $aStatuses));
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:30, 代码来源:relationships.class.php
示例8: process
/**
* Controller
*/
public function process()
{
Phpfox::getUserParam('music.can_access_music', true);
define('PHPFOX_SKIP_IM', true);
$aAlbum = Phpfox::getService('music.album')->getForPlayer($this->request()->getInt('album'));
$bPlayAll = $this->request()->getInt('play') == 1 ? true : false;
if (!isset($aAlbum['album_id'])) {
return Phpfox_Error::display(Phpfox::getPhrase('music.album_you_are_looking_for_cannot_be_found'));
}
$aTracks = Phpfox::getService('music.album')->getTracks($aAlbum['user_id'], $aAlbum['album_id']);
$sPlaylist = '{';
$sNextSong = '{';
foreach ($aTracks as $iKey => $aTrack) {
//$sPlaylist .= '{sPath : "' . $aTrack['song_path'] . '", iId : ' . $aTrack['song_id'] . '},';
$sPlaylist .= '' . $aTrack['song_id'] . ' : "' . $aTrack['song_path'] . '",';
if ($iKey > 0) {
// adding this song's id to the previous song's index
$sNextSong .= ' ' . $aTracks[$iKey - 1]['song_id'] . ' : ' . $aTracks[$iKey]['song_id'] . ',';
}
}
// add the first song to the last song
$sNextSong .= ' ' . $aTracks[$iKey]['song_id'] . ' : ' . $aTracks[0]['song_id'];
$sNextSong .= '}';
$sPlaylist = rtrim($sPlaylist, ',') . '}';
$this->template()->setTitle($aAlbum['name'])->assign(array('aAlbum' => $aAlbum, 'bPlayAll' => true))->setHeader(array('blank.css' => 'style_css', '<script type="text/javascript">$Behavior.music_player_load_player = function() { $Core.player.load({id: \'js_music_player' . ($bPlayAll ? '_all' : '') . '\', type: \'music\', playlist: ' . $sPlaylist . ', aNextSong: ' . $sNextSong . '}); };</script>'))->setTemplate('blank');
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:29, 代码来源:player.class.php
示例9: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
if (!Phpfox::getUserParam('user.can_control_notification_privacy') && !Phpfox::getUserParam('user.can_control_profile_privacy')) {
return Phpfox_Error::display(Phpfox::getPhrase('user.privacy_settings_have_been_disabled_for_your_user_group'));
}
if ($aVals = $this->request()->getArray('val')) {
if (Phpfox::getService('user.privacy.process')->update($aVals)) {
$this->url()->send('user.privacy', null, Phpfox::getPhrase('user.privacy_settings_successfully_updated'));
}
}
list($aUserPrivacy, $aNotifications, $aProfiles, $aItems) = Phpfox::getService('user.privacy')->get();
$aUserInfo = Phpfox::getService('user')->get(Phpfox::getUserId());
($sPlugin = Phpfox_Plugin::get('user.component_controller_index_process')) ? eval($sPlugin) : false;
$aMenus = array('profile' => Phpfox::getPhrase('user.profile'), 'items' => Phpfox::getPhrase('user.items'), 'notifications' => Phpfox::getPhrase('user.notifications'), 'blocked' => Phpfox::getPhrase('user.blocked_users'));
if (!Phpfox::isModule('privacy')) {
unset($aMenus['items']);
}
if (Phpfox::getUserParam('user.can_be_invisible')) {
// $aMenus['invisible'] = Phpfox::getPhrase('user.invisible_mode');
}
$this->template()->buildPageMenu('js_privacy_block', $aMenus, array('no_header_border' => true, 'link' => $this->url()->makeUrl(Phpfox::getUserBy('user_name')), 'phrase' => Phpfox::getPhrase('user.view_your_profile')));
if ($this->request()->get('view') == 'blocked') {
$this->template()->assign(array('bGoToBlocked' => true));
}
$this->template()->setTitle(Phpfox::getPhrase('user.privacy_settings'))->setBreadcrumb('Account', $this->url()->makeUrl('profile'))->setBreadcrumb(Phpfox::getPhrase('user.privacy_settings'), $this->url()->makeUrl('user.privacy'), true)->setFullSite()->setHeader(array('privacy.css' => 'module_user'))->assign(array('aForms' => $aUserPrivacy['privacy'], 'aPrivacyNotifications' => $aNotifications, 'aProfiles' => $aProfiles, 'aUserPrivacy' => $aUserPrivacy, 'aBlockedUsers' => Phpfox::getService('user.block')->get(), 'aUserInfo' => $aUserInfo, 'aItems' => $aItems));
}
开发者ID:lev1976g, 项目名称:core, 代码行数:30, 代码来源:privacy.class.php
示例10: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::getUserParam('photo.can_view_photos', true);
if (!Phpfox::getParam('photo.can_rate_on_photos')) {
return Phpfox_Error::display(Phpfox::getPhrase('photo.photo_rating_is_disabled'));
}
Phpfox::getUserParam('photo.can_rate_on_photos', true);
if ($iPhotoId = $this->request()->getInt('photo-id')) {
Phpfox::getService('photo.rate.process')->add($this->request()->getInt('photo-id'), $this->request()->getInt('rating'));
}
$sCategory = null;
if ($this->request()->get('req3') == 'category') {
$sCategory = $this->request()->getInt('req4');
}
($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_start')) ? eval($sPlugin) : false;
$aPhoto = Phpfox::getService('photo.rate')->getForRating($sCategory, $this->request()->get('id', null));
$sBar = '';
for ($i = 1; $i <= 10; $i++) {
$sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate', array('photo-id' => $aPhoto['photo_id'], 'rating' => $i)) : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'), false, null, array('photo-id' => $aPhoto['photo_id'], 'rating' => $i))) . '" class="js_rating_bar">' . $i . '</a></li>';
}
$sBar .= '<li><a href="' . ($sCategory === null ? $this->url()->makeUrl('photo.rate') : $this->url()->permalink('photo.rate.category', $this->request()->getInt('req4'), $this->request()->get('req5'))) . '">' . Phpfox::getPhrase('photo.skip') . '</a></li>';
$this->setParam('sPhotoCategorySubSystem', 'rate');
$this->setParam('aPhoto', $aPhoto);
$this->setParam('sCurrentCategory', $sCategory);
Phpfox::getService('photo')->buildMenu();
$this->template()->setTitle(Phpfox::getPhrase('photo.rate_photos'))->setBreadcrumb(Phpfox::getPhrase('photo.photos'), $this->url()->makeUrl('photo'))->setHeader('cache', array('rate_bar.css' => 'style_css'))->assign(array('sRatingBar' => $sBar, 'aPhoto' => $aPhoto, 'aCallback' => null));
($sPlugin = Phpfox_Plugin::get('photo.component_controller_rate_process_end')) ? eval($sPlugin) : false;
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:31, 代码来源:rate.class.php
示例11: process
public function process($aFile)
{
return Phpfox_Error::set('Unable to import data using the current routine. Use the manual method of importing data.');
if (!preg_match('/^(.*?)\.zip$/i', $aFile['name']))
{
return Phpfox_Error::set('Not a valid ZIP package.');
}
$sExt = 'zip';
$sLocation = PHPFOX_DIR_CACHE . md5(PHPFOX_TIME . uniqid() . $aFile['name']) . PHPFOX_DS;
mkdir($sLocation);
Phpfox::getLib('archive', $sExt)->extract($aFile['tmp_name'], $sLocation);
$aFiles = Phpfox::getLib('file')->getAllFiles($sLocation);
foreach ($aFiles as $sFile)
{
$sNewFile = str_replace($sLocation, '', $sFile);
$aParts = explode(PHPFOX_DS, $sNewFile);
unset($aParts[(count($aParts) - 1)]);
$sDirPath = implode(PHPFOX_DS, $aParts);
Phpfox::getLib('ftp')->mkdir(PHPFOX_DIR . $sDirPath, true);
Phpfox::getLib('ftp')->put($sFile, PHPFOX_DIR . $sNewFile);
}
Phpfox::getLib('file')->delete_directory($sLocation);
return true;
}
开发者ID:hoanghd, 项目名称:tools, 代码行数:33, 代码来源:import.class.php
示例12: changeEmail
/**
* Changes a user's email addres, checks if user is allowed and if he should be made verify their email address
* afterwards and if it should be logged out immediately after changing it.
* @param <type> $aUser
* @param <type> $sMail
* @return <type>
*/
public function changeEmail($aUser, $sMail)
{
// check if user has enough permissions and the mails dont match if they have to verify the new email upon signup it
if (Phpfox::getUserGroupParam($aUser['user_group_id'], 'user.can_change_email')) {
Phpfox::getService('user.validate')->email($sMail);
if (!Phpfox_Error::isPassed()) {
return false;
}
// check that the new email is not in use.
$sEmail = Phpfox::getLib('parse.input')->prepare($sMail);
$inUse = $this->database()->select('email')->where('email = \'' . $sEmail . '\'')->from(Phpfox::getT('user'))->execute('getSlaveField');
if ($inUse != '') {
return 'Email address already in use';
}
//die(d(Phpfox::getParam('user.verify_email_at_signup'), true));
// set the status to need to be verified only if they are required at signup
if (Phpfox::getParam('user.verify_email_at_signup')) {
$mUser = array('user_id' => $aUser['user_id'], 'email' => Phpfox::getLib('parse.input')->prepare($sMail), 'password' => $aUser['password']);
$this->database()->update(Phpfox::getT('user'), array('status_id' => 1), 'user_id = ' . (int) $aUser['user_id']);
$this->sendMail($mUser);
} else {
// just change the email
$this->database()->update(Phpfox::getT('user'), array('email' => Phpfox::getLib('parse.input')->prepare($sMail)), 'user_id = ' . (int) $aUser['user_id']);
}
//Phpfox::getParam('user.logout_after_change_email_if_verify') && Phpfox::getParam('user.verify_email_at_signup')
// check if they should be logged out immediately after changing it. Only then should their status_id be changed
if (Phpfox::getParam('user.verify_email_at_signup') && Phpfox::getParam('user.logout_after_change_email_if_verify') == true) {
Phpfox::getService('user.auth')->logout();
}
return true;
}
return false;
}
开发者ID:lev1976g, 项目名称:core, 代码行数:40, 代码来源:process.class.php
示例13: process
/**
* Controller
*/
public function process()
{
Phpfox::isUser(true);
// http://www.phpfox.com/tracker/view/15093/
$bIsThickBox = $this->getParam('bIsThickBox');
$this->template()->assign(array('bIsThickBox' => $bIsThickBox));
if ($this->request()->getInt('purchase_id')) {
if (!($aPackage = Phpfox::getService('subscribe.purchase')->getInvoice($this->request()->getInt('purchase_id'), true))) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_purchase_you_are_looking_for'));
}
$iPurchaseId = $aPackage['purchase_id'];
} else {
if (!($aPackage = Phpfox::getService('subscribe')->getPackage($this->request()->getInt('id')))) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.unable_to_find_the_package_you_are_looking_for'));
}
if (Phpfox::getUserBy('user_group_id') == $aPackage['user_group_id']) {
return Phpfox_Error::set(Phpfox::getPhrase('subscribe.attempting_to_upgrade_to_the_same_user_group_you_are_already_in'));
}
$aPackage['default_currency_id'] = isset($aPackage['default_currency_id']) ? $aPackage['default_currency_id'] : $aPackage['price'][0]['alternative_currency_id'];
$aPackage['default_cost'] = isset($aPackage['default_cost']) ? $aPackage['default_cost'] : $aPackage['price'][0]['alternative_cost'];
$iPurchaseId = Phpfox::getService('subscribe.purchase.process')->add(array('package_id' => $aPackage['package_id'], 'currency_id' => $aPackage['default_currency_id'], 'price' => $aPackage['default_cost']));
/* Make sure we mark it as free only if the default cost is free and its not a recurring charge */
if ($aPackage['default_cost'] == '0.00' && $aPackage['recurring_period'] == 0) {
$this->template()->assign('bIsFree', true);
$this->template()->assign('iPurchaseId', $iPurchaseId);
Phpfox::getService('subscribe.purchase.process')->update($iPurchaseId, $aPackage['package_id'], 'completed', Phpfox::getUserId(), $aPackage['user_group_id'], $aPackage['fail_user_group']);
return;
}
}
/* Load the gateway only if its not free */
if (($aPackage['default_cost'] != '0.00' || $aPackage['recurring_period'] != 0) && $iPurchaseId) {
$this->setParam('gateway_data', array('item_number' => 'subscribe|' . $iPurchaseId, 'currency_code' => $aPackage['default_currency_id'], 'amount' => $aPackage['default_cost'], 'item_name' => $aPackage['title'], 'return' => $this->url()->makeUrl('subscribe.complete'), 'recurring' => $aPackage['recurring_period'], 'recurring_cost' => isset($aPackage['default_recurring_cost']) ? $aPackage['default_recurring_cost'] : '', 'alternative_cost' => isset($aPackage['price'][0]) ? serialize($aPackage['price']) : '', 'alternative_recurring_cost' => isset($aPackage['recurring_price'][0]) ? serialize($aPackage['recurring_price']) : ''));
}
}
开发者ID:lev1976g, 项目名称:core, 代码行数:37, 代码来源:upgrade.class.php
示例14: process
/**
* Controller
* This controller handles invalid user group by 2 means:
* 1. getInt('id',0) => if no user group is given its explicitly redirected
* 2. getActivityPoints may return a Phpfox_Error
*/
public function process()
{
$iGroupId = $this->request()->getInt('id', 0);
$aPoints = Phpfox::getService('user.group.setting')->getActivityPoints($iGroupId);
if ($aVals = $this->request()->getArray('val')) {
$oService = Phpfox::getService('user.group.setting.process');
$aUpdate = array();
foreach ($aVals['module'] as $iSetting => $iValue) {
foreach ($aPoints as $iKey => $aPoint) {
if ($aPoint['setting_id'] == $iSetting && $iValue != $aPoint['value_actual']) {
$aUpdate['value_actual'][$iSetting] = $iValue;
/* Update the array to show the change in the template without calling DB again */
$aPoints[$iKey]['value_actual'] = $iValue;
}
}
}
if (!empty($aUpdate)) {
$oService->update($aVals['igroup'], $aUpdate);
}
$iGroupId = $aVals['igroup'];
} else {
if ($iGroupId == 0) {
$this->url()->send('admincp.user.group', null, Phpfox::getPhrase('user.invalid_user_group'));
}
}
$sUserGroup = Phpfox::getService('user.group')->getGroup($iGroupId);
if (!Phpfox_Error::isPassed()) {
$aError = array_unique(Phpfox_Error::get());
$sMessage = implode(', ', $aError);
$this->url()->send('admincp.user.group', null, $sMessage);
}
$this->template()->setBreadcrumb('Manage Activity Points', $this->url()->makeUrl('current'), true)->setTitle('Manage Activity Points')->assign(array('aPoints' => $aPoints, 'aUserGroup' => $sUserGroup))->setHeader(array('activitypoints.css' => 'module_user'));
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:39, 代码来源:activitypoints.class.php
示例15: doPoke
public function doPoke()
{
if (!Phpfox::getUserParam('poke.can_poke')) {
return Phpfox_Error::display(Phpfox::getPhrase('poke.you_are_not_allowed_to_send_pokes'));
}
if (Phpfox::getUserParam('poke.can_only_poke_friends') && !Phpfox::getService('friend')->isFriend(Phpfox::getUserId(), $this->get('user_id'))) {
return Phpfox_Error::display(Phpfox::getPhrase('poke.you_can_only_poke_your_own_friends'));
}
if (Phpfox::getService('poke.process')->sendPoke($this->get('user_id'))) {
/* Type 1 is when poking back from the display block*/
if ($this->get('type') == '1') {
$this->call('$("#poke_' . $this->get('user_id') . '").hide().remove();');
} else {
$this->call('$("#liPoke").hide().remove();');
$this->alert(Phpfox::getPhrase('poke.poke_sent'));
}
} else {
$this->alert(Phpfox::getPhrase('poke.poke_could_not_be_sent'));
}
list($iTotalPokes, $aPokes) = Phpfox::getService('poke')->getPokesForUser(Phpfox::getUserId());
if (!$iTotalPokes) {
$this->call('$("#js_block_border_poke_display").remove();');
} else {
$this->call('$("#poke_' . $this->get('user_id') . '").hide().remove();');
}
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:26, 代码来源:ajax.class.php
示例16: process
/**
* Process the controller
*
*/
public function process()
{
if (Phpfox::isUser()) {
$this->url()->send('');
}
if ($sRequest = $this->request()->get('id')) {
if ($aVals = $this->request()->getArray('val')) {
if (!isset($aVals['newpassword']) || !isset($aVals['newpassword2']) || $aVals['newpassword'] != $aVals['newpassword2']) {
Phpfox_Error::set(Phpfox::getPhrase('user.your_confirmed_password_does_not_match_your_new_password'));
} else {
if (Phpfox::getService('user.password')->updatePassword($sRequest, $aVals)) {
$this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.password_successfully_updated'));
}
}
}
if (Phpfox::getParam('user.shorter_password_reset_routine')) {
if (Phpfox::getService('user.password')->isValidRequest($sRequest) == true) {
$this->template()->assign(array('sRequest' => $sRequest));
} else {
}
} else {
if (Phpfox::getService('user.password')->verifyRequest($sRequest)) {
$this->url()->send('user.password.verify', null, Phpfox::getPhrase('user.new_password_successfully_sent_check_your_email_to_use_your_new_password'));
}
}
}
$this->template()->setTitle(Phpfox::getPhrase('user.password_request_verification'))->setBreadcrumb(Phpfox::getPhrase('user.password_request_verification'));
}
开发者ID:lev1976g, 项目名称:core, 代码行数:32, 代码来源:verify.class.php
示例17: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::getUserParam('language.can_manage_lang_packs', true);
$bNoJsValidation = $this->getParam('bNoJsValidation');
$aModules = Phpfox::getService('admincp.module')->getModules();
$aLanguages = Phpfox::getService('language')->get();
if ($sPhrase = $this->getParam('sVar')) {
$aParts = explode('.', $sPhrase);
$sPhrase = $aParts[1];
}
/*
$aValidation = array(
'var_name' => array(
'def' => 'required',
'title' => Phpfox::getPhrase('language.select_varname')
)
);
*/
$aValidation = array();
$oValid = Phpfox::getLib('validator')->set(array('sFormName' => 'js_phrase_form', 'aParams' => $aValidation));
if ($aVals = $this->request()->getArray('val')) {
if (empty($aVals['var_name']) && isset($aVals['text']['en'])) {
$aVals['var_name'] = $aVals['text']['en'];
}
if (empty($aVals['var_name'])) {
Phpfox_Error::set('Provide a var name.');
}
// Check that all the fields are valid
if ($oValid->isValid($aVals)) {
// Check to make sure the phrase has not already been added
if ($sIsPhrase = Phpfox::getService('language.phrase')->isPhrase($aVals)) {
Phpfox_Error::set(Phpfox::getPhrase('language.phrase_already_created', array('phrase' => $sIsPhrase)) . ' - ' . Phpfox::getPhrase($sIsPhrase));
$sCachePhrase = $sIsPhrase;
} else {
$sVarName = Phpfox::getService('language.phrase.process')->prepare($aVals['var_name']);
if (isset($aVals['module'])) {
$aParts = explode('|', $aVals['module']);
$sVarName = $aParts[1] . '.' . $sVarName;
}
$sCached = Phpfox::getPhrase('language.phrase_added', array('phrase' => $sVarName));
// Add the new phrase
$sPhrase = Phpfox::getService('language.phrase.process')->add($aVals);
// Verify if we have a return URL, if we do send them there instead
if ($sReturn = $this->request()->get('return')) {
$this->url()->forward($sReturn, $sCached);
} else {
Phpfox::getLib('session')->set('cache_new_phrase', $sVarName);
// Phrase added lets send them back to the same page with a message that the phrase was added
$this->url()->send('admincp.language.phrase.add', array('last-module' => $aParts[1]), $sCached);
}
}
}
}
if (!isset($sCachePhrase) && ($sCachePhrase = Phpfox::getLib('session')->get('cache_new_phrase'))) {
Phpfox::getLib('session')->remove('cache_new_phrase');
}
// Assign needed vars to the template
$this->template()->assign(array('aProducts' => Phpfox::getService('admincp.product')->get(), 'aModules' => $aModules, 'aLanguages' => $aLanguages, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $bNoJsValidation ? 'return true;' : $oValid->getJsForm(), 'sReturn' => ($sReturn = $this->request()->get('return')) ? $sReturn : $this->getParam('sReturnUrl'), 'sVar' => $sPhrase, 'sCachePhrase' => isset($sCachePhrase) ? $sCachePhrase : '', 'sLastModuleId' => $this->request()->get('last-module')))->setBreadCrumb(Phpfox::getPhrase('language.add_phrase'))->setTitle(Phpfox::getPhrase('language.add_phrase'));
($sPlugin = Phpfox_Plugin::get('language.component_controller_admincp_phrase_add_process')) ? eval($sPlugin) : false;
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:63, 代码来源:add.class.php
示例18: process
public function process()
{
if ($this->request()->get('vidlypost')) {
/*
$hFile = fopen(PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'vidly.log', 'a+');
fwrite($hFile, print_r($_REQUEST, true) . "\n");
fclose($hFile);
*/
if ($this->request()->get('vidlypost') == 'AddMedia') {
Phpfox::getService('video.process')->vidlyUpdateNewUrl($this->request()->getInt('vidid'), $_REQUEST);
}
exit;
}
if (!isset($_POST['hash'])) {
echo json_encode(array('error' => true, 'error_message' => 'No post hash'));
}
if ($iId = Phpfox::getService('video')->checkVidlyHash($_POST['hash'])) {
if (isset($_POST['cmd']) && $_POST['cmd'] == 'done') {
if (!Phpfox::getService('video.process')->vidlyIsDone()) {
echo json_encode(array('error' => true, 'error_message' => implode('', Phpfox_Error::get())));
}
}
echo json_encode(array('passed' => true, 'vidly_id' => $iId));
} else {
echo json_encode(array('error' => true, 'error_message' => implode('', Phpfox_Error::get())));
}
exit;
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:28, 代码来源:vidly.class.php
示例19: process
/**
* Controller
*/
public function process()
{
if (Phpfox::getParam('core.phpfox_is_hosted')) {
$this->url()->send('admincp');
}
$oArchiveExport = Phpfox::getLib('archive.export')->set(array('zip'));
$oArchiveImport = Phpfox::getLib('archive.import')->set(array('zip'));
if (($sExportId = $this->request()->get('id')) && !empty($sExportId)) {
if ($sData = Phpfox::getService('emoticon')->export($sExportId)) {
$oArchiveExport->download('phpfox-emoticon-' . $sExportId, 'xml', $sData);
}
}
if (isset($_FILES['import']) && ($aFile = $_FILES['import'])) {
if (preg_match('/^phpfox-emoticon-(.*?)\\.xml$/i', $aFile['name'], $aMatches)) {
if ($sXmlData = file_get_contents($aFile['tmp_name'])) {
$aParams = Phpfox::getLib('xml.parser')->parse($sXmlData);
if (($mReturn = Phpfox::getService('emoticon.process')->import($this->request()->getArray('val'), $aParams)) && is_array($mReturn)) {
$this->url()->send('admincp.emoticon.view', array('id' => $mReturn['id']), Phpfox::getPhrase('emoticon.emoticon_package_successfully_created', array('success' => $mReturn['success'], 'failed' => $mReturn['failed'])));
}
}
} else {
Phpfox_Error::set(Phpfox::getPhrase('emoticon.not_a_valid_emoticon_package_to_import'));
}
}
$this->template()->setTitle(Phpfox::getPhrase('emoticon.import_emoticons'))->setBreadcrumb(Phpfox::getPhrase('emoticon.emoticons'), $this->url()->makeUrl('admincp.emoticon.package'))->setBreadCrumb(Phpfox::getPhrase('emoticon.import_emoticons'), null, true);
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:29, 代码来源:file.class.php
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1586| 2022-08-30
joaomh/curso-de-matlab
阅读:1149| 2022-08-17
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1003| 2022-11-06
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1081| 2022-08-17
tpoechtrager/cctools-port: Apple cctools port for Linux and *BSD
阅读:480| 2022-08-15
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:764| 2022-08-16
”云”或者’云滴‘是云模型的基本单元,所谓云是指在其论域上的一个分布,可以用联合
阅读:545| 2022-07-18
Vulnerability in the Oracle Solaris product of Oracle Systems (component: SMB Se
阅读:466| 2022-07-29
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:361| 2022-11-06
Windows Hyper-V Information Disclosure Vulnerability. This CVE ID is unique from
阅读:936| 2022-07-29
请发表评论