• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SJB_UserManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: execute

 public function execute()
 {
     $count_listing = SJB_Request::getVar('count_listing', 10);
     $listings_structure = array();
     $listing_structure_meta_data = array();
     $tp = SJB_System::getTemplateProcessor();
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_sid = SJB_UserManager::getCurrentUserSID();
         $viewed_listings = SJB_UserManager::getRecentlyViewedListingsByUserSid($user_sid, $count_listing);
         if (count($viewed_listings)) {
             foreach ($viewed_listings as $viewed_listing) {
                 $listing = SJB_ListingManager::getObjectBySID($viewed_listing['listing_sid']);
                 if (empty($listing)) {
                     continue;
                 }
                 $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
                 $listings_structure[] = $listing_structure;
                 if (isset($listing_structure['METADATA'])) {
                     $listing_structure_meta_data = array_merge($listing_structure_meta_data, $listing_structure['METADATA']);
                 }
             }
             $metaDataProvider = SJB_ObjectMother::getMetaDataProvider();
             $tp->assign("METADATA", array("listing" => $metaDataProvider->getMetaData($listing_structure_meta_data)));
             $tp->assign("listings", $listings_structure);
         }
         $tp->display('recently_viewed_listings.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:recently_viewed_listings.php


示例2: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     if (isset($_REQUEST['ajax'])) {
         $sent = 0;
         $ids = array();
         if (isset($_REQUEST['userids'])) {
             $ids = $_REQUEST['userids'];
             foreach ($ids as $user_sid) {
                 if (!empty($user_sid) && SJB_Notifications::sendUserActivationLetter($user_sid)) {
                     $sent++;
                 }
             }
         }
         $tp->assign("countOfSuccessfulSent", $sent);
         $tp->assign("countOfUnsuccessfulSent", count($ids) - $sent);
         $tp->display("send_activation_letter.tpl");
         exit;
     }
     $user_sid = SJB_Request::getVar('usersid', null);
     $error = null;
     if (!SJB_UserManager::getObjectBySID($user_sid)) {
         $error = "USER_DOES_NOT_EXIST";
     } elseif (!SJB_Notifications::sendUserActivationLetter($user_sid)) {
         $error = "CANNOT_SEND_EMAIL";
     }
     $tp->assign("error", $error);
     $tp->display("send_activation_letter.tpl");
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:send_activation_letter.php


示例3: canRate

 public static function canRate($listing_sid, $title = false)
 {
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_info = SJB_UserManager::getCurrentUserInfo();
         $user_id = $user_info['sid'];
     } else {
         if ($title) {
             self::$title = 3;
         }
         //'Please sign in to vote ';
         return false;
     }
     $result = SJB_DB::query("SELECT vote FROM `rating` WHERE `user_id` = {$user_id} AND listing_id = ?n ", $listing_sid);
     if (count($result) == 0) {
         if ($title) {
             self::$title = 1;
         }
         //'Please, Vote!';
         return true;
     }
     if ($title) {
         self::$title = 2;
     }
     //"You've already voted";
     return false;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:26,代码来源:Rating.php


示例4: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user = SJB_UserManager::getCurrentUser();
     if ($user) {
         $userNotificationsManager = new SJB_UserNotificationsManager($user);
         $userNotificationsInfo = $userNotificationsManager->getUserNotificationsInfo();
         $userNotificationsInfo = array_merge($userNotificationsInfo, $_REQUEST);
         $userNotifications = new SJB_UserNotifications($userNotificationsInfo);
         $userNotificationsForm = new SJB_Form($userNotifications);
         $userNotificationsForm->registerTags($tp);
         $userNotificationsFields = $userNotificationsForm->getFormFieldsInfo();
         $tp->assign('form_fields', $userNotificationsFields);
         if (SJB_Request::getVar('action') === 'save') {
             $errors = array();
             if ($userNotificationsForm->isDataValid($errors)) {
                 $userNotifications->update();
                 $tp->assign('isSaved', true);
             }
             $tp->assign('errors', $errors);
         }
         $tp->assign('userNotificationGroups', $userNotificationsManager->getNotificationGroups()->getGroups());
         $tp->assign('userNotifications', $userNotificationsManager->getEnabledForGroupUserNotifications());
         $listingTypes = SJB_ListingTypeManager::getListingTypeByUserSID($user->getSID());
         $approveSetting = SJB_ListingTypeManager::getWaitApproveSettingByListingType($listingTypes);
         $tp->assign('approve_setting', $approveSetting);
         $tp->display('user_notifications.tpl');
     } else {
         $tp->display('login.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:user_notifications.php


示例5: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user = SJB_UserManager::getUserInfoBySID(SJB_Request::getVar('user_sid', 0, SJB_Request::METHOD_GET));
     $user_id = $user['sid'];
     if (SJB_Request::getVar('pm_action', '', SJB_Request::METHOD_POST) == 'delete') {
         $checked = SJB_Request::getVar('pm_check', array(), SJB_Request::METHOD_POST);
         SJB_PrivateMessage::delete($checked);
     }
     $page = intval(SJB_Request::getVar('page', 1, SJB_Request::METHOD_GET));
     $per_page = 10;
     $total = SJB_PrivateMessage::getTotalOutbox($user_id);
     $max_pages = ceil($total / $per_page);
     if ($max_pages == 0) {
         $max_pages = 1;
     }
     if ($max_pages < $page) {
         SJB_HelperFunctions::redirect("?user_sid={$user_id}&page={$max_pages}");
     }
     $navigate = SJB_PrivateMessage::getNavigate($page, $total, $per_page);
     $list = SJB_PrivateMessage::getListOutbox($user_id, $page, $per_page);
     $userGroupInfo = SJB_UserGroupManager::getUserGroupInfoBySID($user['user_group_sid']);
     SJB_System::setGlobalTemplateVariable('wikiExtraParam', $userGroupInfo['id']);
     $tp->assign("user_group_info", $userGroupInfo);
     $tp->assign('username', $user['username']);
     $tp->assign('user_sid', $user_id);
     $tp->assign('message', $list);
     $tp->assign('navigate', $navigate);
     $tp->assign('page', $page);
     $tp->display('pm_outbox.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:pm_outbox.php


示例6: execute

 public function execute()
 {
     ini_set('max_execution_time', 0);
     $tp = SJB_System::getTemplateProcessor();
     $userGroupID = SJB_Request::getVar('user_group_id', 0);
     $user = SJB_UsersExportController::createUser($userGroupID);
     $searchFormBuilder = new SJB_SearchFormBuilder($user);
     $criteria = $searchFormBuilder->extractCriteriaFromRequestData($_REQUEST, $user);
     $searchFormBuilder->registerTags($tp);
     $searchFormBuilder->setCriteria($criteria);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $exportProperties = SJB_Request::getVar('export_properties', array());
         if (empty($exportProperties)) {
             SJB_FlashMessages::getInstance()->addWarning('EMPTY_EXPORT_PROPERTIES');
         } else {
             $innerJoin = false;
             if (isset($_REQUEST['product']['multi_like']) && $_REQUEST['product']['multi_like'] != '') {
                 $products = $_REQUEST['product']['multi_like'];
                 if (is_array($products)) {
                     $products = implode(',', $products);
                 }
                 $whereParam = implode(',', explode(',', SJB_DB::quote($products)));
                 $innerJoin = array('contracts' => array('join_field' => 'user_sid', 'join_field2' => 'sid', 'join' => 'INNER JOIN', 'where' => "AND FIND_IN_SET(`contracts`.`product_sid`, '{$whereParam}')"));
                 unset($criteria['system']['product']);
             }
             $searcher = new SJB_UserSearcher(false, 'parent_sid', 'ASC', $innerJoin);
             $searchAliases = SJB_UsersExportController::getSearchPropertyAliases();
             $foundUsersSid = $searcher->getObjectsSIDsByCriteria($criteria, $searchAliases);
             if (!empty($foundUsersSid)) {
                 $result = SJB_UsersExportController::createExportDirectories();
                 if ($result === true) {
                     $exportProperties['extUserID'] = 1;
                     $exportProperties['parent_sid'] = 1;
                     $exportAliases = SJB_UsersExportController::getExportPropertyAliases();
                     $exportData = SJB_UsersExportController::getExportData($foundUsersSid, $exportProperties, $exportAliases);
                     $fileName = 'users.xls';
                     SJB_UsersExportController::makeExportFile($exportData, $fileName);
                     if (!file_exists(SJB_System::getSystemSettings('EXPORT_FILES_DIRECTORY') . "/{$fileName}")) {
                         SJB_FlashMessages::getInstance()->addWarning('CANT_CREATE_EXPORT_FILES');
                     } else {
                         SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . "/users/archive-and-send-export-data/");
                     }
                 }
             } else {
                 SJB_FlashMessages::getInstance()->addWarning('EMPTY_EXPORT_DATA');
             }
         }
     }
     $userSystemProperties = SJB_UserManager::getAllUserSystemProperties();
     $userGroups = SJB_UserGroupManager::getAllUserGroupsInfo();
     $userCommonProperties = array();
     foreach ($userGroups as $userGroup) {
         $userGroupProperties = SJB_UserProfileFieldManager::getFieldsInfoByUserGroupSID($userGroup['sid']);
         $userCommonProperties[$userGroup['id']] = $userGroupProperties;
     }
     $tp->assign('userSystemProperties', $userSystemProperties);
     $tp->assign('userCommonProperties', $userCommonProperties);
     $tp->assign('selected_user_group_id', $userGroupID);
     $tp->display('export_users.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:60,代码来源:export_users.php


示例7: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $listing_types = SJB_ListingTypeManager::getAllListingTypesInfo();
     $countListings = array();
     foreach ($listing_types as $type) {
         $requested_data = array();
         $requested_data['action'] = 'search';
         $requested_data['active']['equal'] = '1';
         $requested_data['listing_type']['equal'] = $type['id'];
         $requireApprove = SJB_ListingTypeManager::getWaitApproveSettingByListingType($type['sid']);
         if ($requireApprove) {
             $requested_data['status']['equal'] = 'approved';
         }
         $listing = new SJB_Listing(array(), $type['sid']);
         $id_alias_info = $listing->addIDProperty();
         $listing->addActivationDateProperty();
         $username_alias_info = $listing->addUsernameProperty();
         $listing_type_id_info = $listing->addListingTypeIDProperty();
         $listing->addCompanyNameProperty();
         if ($type['id'] == 'Resume') {
             $requested_data['access_type'] = array('accessible' => SJB_UserManager::getCurrentUserSID());
         }
         $criteria = SJB_SearchFormBuilder::extractCriteriaFromRequestData($requested_data, $listing);
         $aliases = new SJB_PropertyAliases();
         $aliases->addAlias($id_alias_info);
         $aliases->addAlias($username_alias_info);
         $aliases->addAlias($listing_type_id_info);
         $searcher = new SJB_ListingSearcher();
         $countListings[$type['id']] = $searcher->countRowsByCriteria($criteria, $aliases);
     }
     $tp->assign('listings_types', $countListings);
     $tp->display('count_listings.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:34,代码来源:count_listings.php


示例8: execute

 public function execute()
 {
     $template_processor = SJB_System::getTemplateProcessor();
     $username = SJB_Request::getVar('username', null);
     $verification_key = SJB_Request::getVar('verification_key', null);
     $ERRORS = array();
     $password_was_changed = false;
     $user_info = SJB_UserManager::getUserInfoByUserName($username);
     if (empty($user_info)) {
         $ERRORS['EMPTY_USERNAME'] = 1;
     } elseif (empty($verification_key)) {
         $ERRORS['EMPTY_VERIFICATION_KEY'] = 1;
     } elseif ($user_info['verification_key'] != $verification_key) {
         $ERRORS['WRONG_VERIFICATION_KEY'] = 1;
     } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
         if (!empty($_REQUEST['password']) && $_REQUEST['password'] == $_REQUEST['confirm_password']) {
             $password_was_changed = SJB_UserManager::changeUserPassword($user_info['sid'], $_REQUEST['password']);
         } else {
             $ERRORS['PASSWORD_NOT_CONFIRMED'] = 1;
         }
     }
     if ($password_was_changed) {
         $template_processor->display('successful_password_change.tpl');
     } else {
         $template_processor->assign('username', $username);
         $template_processor->assign('verification_key', $verification_key);
         $template_processor->assign('errors', $ERRORS);
         $template_processor->display('change_password.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:30,代码来源:change_password.php


示例9: saveInvoice

 public static function saveInvoice($invoice)
 {
     $serializedItemsDetails['items'] = $invoice->getPropertyValue('items');
     $products = isset($serializedItemsDetails['items']['products']) ? $serializedItemsDetails['items']['products'] : array();
     $products = implode(',', $products);
     $invoice->addProperty(array('id' => 'serialized_items_info', 'type' => 'text', 'value' => serialize($serializedItemsDetails), 'is_system' => true));
     $invoice->addProperty(array('id' => 'product_sid', 'type' => 'string', 'value' => $products, 'is_system' => true));
     $invoice->deleteProperty('items');
     $serializedTaxDetails['tax_info'] = $invoice->getPropertyValue('tax_info');
     $invoice->addProperty(array('id' => 'serialized_tax_info', 'type' => 'text', 'value' => serialize($serializedTaxDetails), 'is_system' => true));
     $invoice->deleteProperty('tax_info');
     $user_sid = $invoice->getPropertyValue('user_sid');
     $user_info = SJB_UserManager::getUserInfoBySID($user_sid);
     if (!empty($user_info['parent_sid'])) {
         $invoice->setPropertyValue('subuser_sid', $user_sid);
         $invoice->setPropertyValue('user_sid', $user_info['parent_sid']);
     }
     $dateProperty = $invoice->getProperty('date');
     $value = $dateProperty->getValue();
     if (!$dateProperty->type->getConvertToDBDate() && $value != null) {
         $invoice->setPropertyValue('date', SJB_I18N::getInstance()->getDate($value));
     }
     $invoice->setPropertyValue('sub_total', SJB_I18N::getInstance()->getFloat($invoice->getPropertyValue('sub_total')));
     $invoice->setPropertyValue('total', SJB_I18N::getInstance()->getFloat($invoice->getPropertyValue('total')));
     parent::saveObject('invoices', $invoice);
     if ($value == null) {
         SJB_DB::query('UPDATE `invoices` SET `date`= NOW() WHERE `sid`=?n', $invoice->getSID());
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:29,代码来源:InvoiceManager.php


示例10: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_id = SJB_UserManager::getCurrentUserSID();
         if (SJB_Request::getVar('pm_action', '', SJB_Request::METHOD_POST) == 'delete') {
             $checked = SJB_Request::getVar('pm_check', array(), SJB_Request::METHOD_POST);
             SJB_PrivateMessage::delete($checked);
         }
         $page = intval(SJB_Request::getVar('page', 1, SJB_Request::METHOD_GET));
         $messagesPerPage = SJB_Request::getInt('messagesPerPage', 10);
         $total = SJB_PrivateMessage::getTotalOutbox($user_id);
         $totalPages = ceil($total / $messagesPerPage);
         if ($totalPages == 0) {
             $totalPages = 1;
         }
         if (empty($page) || $page <= 0) {
             $page = 1;
         }
         if ($totalPages < $page) {
             SJB_HelperFunctions::redirect("?page={$totalPages}");
         }
         $list = SJB_PrivateMessage::getListOutbox($user_id, $page, $messagesPerPage);
         $tp->assign('message_list', $list);
         $tp->assign('messagesPerPage', $messagesPerPage);
         $tp->assign('page', $page);
         $tp->assign('totalPages', $totalPages);
         $tp->assign('include', 'list_outbox.tpl');
         $tp->assign('unread', SJB_PrivateMessage::getCountUnreadMessages($user_id));
     }
     $tp->display('main.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:32,代码来源:private_messages_outbox.php


示例11: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $errors = array();
     $listingTypeID = SJB_Request::getVar('listing_type_id', '');
     if (SJB_UserManager::isUserLoggedIn()) {
         if (!SJB_Acl::getInstance()->isAllowed('save_' . trim($listingTypeID))) {
             $errors[] = 'DENIED_VIEW_SAVED_LISTING';
         }
         if (!$errors) {
             $userSid = SJB_UserManager::getCurrentUserSID();
             if (SJB_Request::getVar('action', '') == 'delete') {
                 $listing_id = SJB_Request::getVar('listing_id', null);
                 if (!is_null($listing_id)) {
                     foreach ($listing_id as $key => $value) {
                         SJB_SavedListings::deleteListingFromDBBySID($key, $userSid);
                     }
                     SJB_HelperFunctions::redirect(SJB_System::getSystemSettings("SITE_URL") . SJB_Navigator::getURI());
                 }
             }
             $saved_listings_id = SJB_SavedListings::getSavedListingsFromDB($userSid);
             $listings_structure = array();
             $listing_structure_meta_data = array();
             foreach ($saved_listings_id as $saved_listing) {
                 $saved_listing_id = $saved_listing['listing_sid'];
                 $listing = SJB_ListingManager::getObjectBySID($saved_listing_id);
                 if (is_null($listing)) {
                     continue;
                 }
                 $listing->addPicturesProperty();
                 $listing_structure = SJB_ListingManager::createTemplateStructureForListing($listing);
                 $listings_structure[$listing->getID()] = $listing_structure;
                 $listings_structure[$listing->getID()]['saved_listing'] = $saved_listing;
                 if (isset($listing_structure['METADATA'])) {
                     $listing_structure_meta_data = array_merge($listing_structure_meta_data, $listing_structure['METADATA']);
                 }
             }
             $metaDataProvider = SJB_ObjectMother::getMetaDataProvider();
             $tp->assign("METADATA", array("listing" => $metaDataProvider->getMetaData($listing_structure_meta_data)));
             $tp->assign("listings", $listings_structure);
             $tp->assign("listing_type_id", $listingTypeID);
             $tp->display("saved_listings.tpl");
         } else {
             $tp->assign("errors", $errors);
             $tp->display("save_search_failed.tpl");
         }
     } else {
         $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/system/classifieds" . SJB_System::getURI());
         switch ($listingTypeID) {
             case 'job':
                 $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/saved-jobs/");
                 break;
             case 'resume':
                 $url = base64_encode(SJB_System::getSystemSettings("SITE_URL") . "/saved-resumes/");
                 break;
         }
         $tp->assign("return_url", $url);
         $tp->display("../users/login.tpl");
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:60,代码来源:saved_listings.php


示例12: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     if (SJB_UserManager::isUserLoggedIn()) {
         $user_id = SJB_UserManager::getCurrentUserSID();
         $errors = array();
         $id = SJB_Request::getInt('id', 0, 'GET');
         $action = SJB_Request::getVar('action', '', 'GET');
         if ($id > 0) {
             // read message
             if (SJB_PrivateMessage::isMyMessage($id)) {
                 if ($action == 'delete') {
                     SJB_PrivateMessage::delete(array($id));
                     SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/private-messages/inbox/');
                 }
                 $message = SJB_PrivateMessage::readMessage($id);
                 SJB_Authorization::updateCurrentUserSession();
                 $current_user_info = SJB_UserManager::createTemplateStructureForCurrentUser();
                 $current_user_info['logged_in'] = true;
                 $current_user_info['new_messages'] = SJB_PrivateMessage::getCountUnreadMessages($current_user_info['id']);
                 SJB_System::setCurrentUserInfo($current_user_info);
                 $tp->assign('message', $message);
                 $tp->assign('include', 'message_detail.tpl');
             } else {
                 $errors['NOT_EXISTS_MESSAGE'] = 1;
             }
         }
         $tp->assign('errors', $errors);
         $tp->assign('unread', SJB_PrivateMessage::getCountUnreadMessages($user_id));
         $tp->display('main.tpl');
     } else {
         $tp->assign('return_url', base64_encode(SJB_Navigator::getURIThis()));
         $tp->display('../users/login.tpl');
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:35,代码来源:private_messages_read.php


示例13: login

 public static function login($request)
 {
     $blogPath = SJB_Settings::getSettingByName('blog_path');
     if (empty($blogPath)) {
         return;
     }
     $username = $request['username'];
     $password = $request['password'];
     $userInfo = SJB_UserManager::getUserInfoByUserName($username);
     $userInfo = $userInfo ? base64_encode(serialize($userInfo)) : false;
     $url = SJB_System::getSystemSettings('SITE_URL') . $blogPath . '/wp-login.php';
     $client = new Zend_Http_Client($url, array('useragent' => SJB_Request::getUserAgent(), 'maxredirects' => 0));
     $client->setCookieJar();
     $client->setCookie($_COOKIE);
     $client->setMethod(Zend_Http_Client::POST);
     $client->setParameterPost(array('log' => $username, 'pwd' => $password, 'noSJB' => 1, 'userInfo' => $userInfo, 'wp-submit' => 'Log in'));
     try {
         $response = $client->request();
         foreach ($response->getHeaders() as $key => $header) {
             if ('set-cookie' == strtolower($key)) {
                 if (is_array($header)) {
                     foreach ($header as $val) {
                         header("Set-Cookie: " . $val, false);
                     }
                 } else {
                     header("Set-Cookie: " . $header, false);
                 }
             }
         }
         $_SESSION['wp_cookie_jar'] = @serialize($client->getCookieJar());
     } catch (Exception $ex) {
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:33,代码来源:wordpress_bridge_plugin.php


示例14: deleteContract

 public static function deleteContract($contract_id, $user_sid = false)
 {
     $contract = new SJB_Contract(array('contract_id' => $contract_id, 'user_sid' => $user_sid));
     SJB_ContractManager::deleteContractIDFromNotificationSended($contract_id);
     if ($contract->isFeaturedProfile()) {
         $allContracts = self::getAllContractsInfoByUserSID($user_sid);
         $featured = 0;
         foreach ($allContracts as $userContract) {
             if ($userContract['id'] != $contract_id) {
                 $userContract = new SJB_Contract(array('contract_id' => $userContract['id'], 'user_sid' => $user_sid));
                 if ($userContract->isFeaturedProfile()) {
                     $featured = 1;
                     break;
                 }
             }
         }
         if ($featured == 0) {
             SJB_UserManager::removeFromFeaturedBySID($user_sid);
         }
     }
     if ($contract->product_type == 'banners') {
         $banner = new SJB_Banners();
         $contractBannerID = $banner->getBannerIDByContract($contract_id);
         if ($contractBannerID) {
             $banner->deleteBanner($contractBannerID);
         }
     }
     $permissions = SJB_Acl::getInstance();
     $permissions->clearPermissions('contract', $contract_id);
     return $contract->delete();
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:31,代码来源:ContractManager.php


示例15: execute

 public function execute()
 {
     $listing_id = isset($_REQUEST['listing_id']) ? $_REQUEST['listing_id'] : null;
     $listing = SJB_ListingManager::getObjectBySID($listing_id);
     $current_user = SJB_UserManager::getCurrentUser();
     $template_processor = SJB_System::getTemplateProcessor();
     if (is_null($listing_id)) {
         $errors['PARAMETERS_MISSED'] = 1;
     } elseif (empty($current_user)) {
         $errors['NOT_LOGGED_IN'] = 1;
     } elseif (is_null($listing)) {
         $errors['WRONG_PARAMETERS_SPECIFIED'] = 1;
     } elseif ($listing->getUserSID() != $current_user->getSID()) {
         $errors['NOT_OWNER'] = 1;
     } else {
         $productInfo = $listing->getProductInfo();
         $listing_info = SJB_ListingManager::getListingInfoBySID($listing_id);
         $listing_type_info = SJB_ListingTypeManager::getListingTypeInfoBySID($listing_info['listing_type_sid']);
         $waitApprove = $listing_type_info['waitApprove'];
         $listing_info['type'] = array('id' => $listing_type_info['id'], 'caption' => $listing_type_info['name']);
         $listing_info['product'] = $productInfo;
         $template_processor->assign("listing", $listing_info);
         $contract_id = $listing_info['contract_id'];
         $template_processor->assign("waitApprove", $waitApprove);
     }
     $template_processor->assign("errors", isset($errors) ? $errors : null);
     $template_processor->display("manage_listing.tpl");
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:manage_listing.php


示例16: addStatistics

 public static function addStatistics($event, $type = '', $objectSID = 0, $unique = false, $featured = 0, $priority = 0, $userSID = false, $price = 0, $plugin = '', $reactivate = 0)
 {
     if (!$userSID) {
         $userSID = SJB_UserManager::getCurrentUserSID();
         $userSID = $userSID ? $userSID : 0;
     }
     $IP = $_SERVER['REMOTE_ADDR'];
     $params = array('ip' => $IP, 'type' => $type, 'event' => $event, 'date' => 'YEAR(CURDATE()) = YEAR(`date`) AND DAYOFYEAR(CURDATE()) = DAYOFYEAR(`date`)', 'object_sid' => $objectSID, 'limit' => 1, 'price' => $price);
     if (!in_array($event, array('siteView', 'viewMobileVersion'))) {
         $params['user_sid'] = $userSID;
     }
     $browsingEvents = array('viewListing', 'siteView', 'partneringSites', 'showInSearchResults');
     if (SJB_Request::isBot() && in_array($event, $browsingEvents)) {
         return false;
     } else {
         if ($statistics = self::getStatistics($params)) {
             $statistics = array_pop($statistics);
             if (!$unique) {
                 SJB_DB::query("UPDATE `statistics` SET `count` = ?n WHERE `sid` = ?n", ++$statistics['count'], $statistics['sid']);
             } elseif ($userSID && $statistics['user_sid'] == 0) {
                 SJB_DB::query("UPDATE `statistics` SET `user_sid` = ?n WHERE `sid` = ?n", $userSID, $statistics['sid']);
             }
         } else {
             SJB_DB::query("INSERT INTO `statistics` (`user_sid`, `ip`, `event`, `object_sid`, `type`, `date`, `featured`, `priority`, `reactivate`, `price`, `plugin`) VALUES (?n, ?s, ?s, ?n, ?s, NOW(), ?n, ?n, ?n, ?f, ?s)", $userSID, $IP, $event, $objectSID, $type, $featured, $priority, $reactivate, $price, $plugin);
         }
         return true;
     }
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:28,代码来源:Statistics.php


示例17: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $errors = array();
     $listingSID = SJB_Request::getVar('listing_id', false);
     if ($listingSID == false) {
         $errors['UNDEFINED_LISTING_ID'] = 1;
     } else {
         $queryParams = '';
         $userInfo = SJB_UserManager::getCurrentUserInfo();
         // if logged user
         if (!empty($userInfo)) {
             $firstName = !empty($userInfo['FirstName']) ? $userInfo['FirstName'] : false;
             $lastName = !empty($userInfo['LastName']) ? $userInfo['LastName'] : false;
             $town = !empty($userInfo['City']) ? $userInfo['City'] : false;
             $postCode = !empty($userInfo['ZipCode']) ? $userInfo['ZipCode'] : false;
             $email = !empty($userInfo['email']) ? $userInfo['email'] : false;
             $phone = !empty($userInfo['PhoneNumber']) ? $userInfo['PhoneNumber'] : false;
             // Optional prefilled params for apply for JogG8
             //	  * Title
             //    * FirstName
             //    * LastName
             //    * Town
             //    * PostCode
             //    * HomeTelephone
             //    * WorkTelephone
             //    * Mobile
             //    * Email
             //    * ContactedPreviously
             if ($firstName) {
                 $queryParams .= '&FirstName=' . urlencode($firstName);
             }
             if ($lastName) {
                 $queryParams .= '&LastName=' . urlencode($lastName);
             }
             if ($town) {
                 $queryParams .= '&Town=' . urlencode($town);
             }
             if ($postCode) {
                 $queryParams .= '&PostCode=' . urlencode($postCode);
             }
             if ($phone) {
                 $queryParams .= '&Mobile=' . urlencode($phone);
             }
             if ($email) {
                 $queryParams .= '&Email=' . urlencode($email);
             }
         }
         $listing = SJB_ListingManager::getObjectBySID($listingSID);
         if (!$listing) {
             $errors['WRONG_LISTING_ID_SPECIFIED'] = 1;
         } else {
             $applicationSettings = $listing->getPropertyValue('ApplicationSettings');
             $tp->assign('applicationURL', $applicationSettings['value'] . $queryParams);
         }
     }
     $tp->assign('errors', $errors);
     $tp->display("apply_now_jobg8.tpl");
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:59,代码来源:apply_now_jobg8.php


示例18: execute

 public function execute()
 {
     $tp = SJB_System::getTemplateProcessor();
     $user_group_sid = SJB_Request::getVar('sid', null);
     $errors = array();
     if (!is_null($user_group_sid)) {
         $action = SJB_Request::getVar("action", false);
         $product_sid = SJB_Request::getVar("product_sid", false);
         if ($action && $product_sid !== false) {
             switch ($action) {
                 case 'move_up':
                     SJB_ProductsManager::moveUpProductBySID($product_sid, $user_group_sid);
                     break;
                 case 'move_down':
                     SJB_ProductsManager::moveDownProductBySID($product_sid, $user_group_sid);
                     break;
                 case 'set_default_product':
                     SJB_UserGroupManager::setDefaultProduct($user_group_sid, $product_sid);
                     break;
             }
         }
         $user_group_info = SJB_UserGroupManager::getUserGroupInfoBySID($user_group_sid);
         $user_group_info = array_merge($user_group_info, $_REQUEST);
         $userGroup = new SJB_UserGroup($user_group_info);
         $userGroup->setSID($user_group_sid);
         $edit_user_group_form = new SJB_Form($userGroup);
         $form_is_submitted = SJB_Request::getVar('submit');
         if ($form_is_submitted && $edit_user_group_form->isDataValid($errors)) {
             SJB_UserGroupManager::saveUserGroup($userGroup);
             if ($form_is_submitted == 'save_info') {
                 SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/user-groups/');
             }
         }
         $productSIDs = SJB_ProductsManager::getProductsInfoByUserGroupSID($user_group_sid);
         $productsInfo = array();
         $user_sids_in_group = SJB_UserManager::getUserSIDsByUserGroupSID($user_group_sid);
         $user_group_product_user_number = array();
         foreach ($productSIDs as $product) {
             $productsInfo[] = $product;
             $user_sids_in_product = SJB_UserManager::getUserSIDsByProductSID($product['sid']);
             $user_number = count(array_intersect($user_sids_in_group, $user_sids_in_product));
             $user_group_product_user_number[$product['sid']] = $user_number;
         }
         $edit_user_group_form->registerTags($tp);
         $tp->assign('object_sid', $userGroup->getSID());
         $tp->assign('notifications', $userGroup->getNotifications());
         $tp->assign('notificationGroups', $userGroup->getNotificationsGroups());
         $tp->assign('user_group_sid', $user_group_sid);
         $tp->assign('user_group_products_info', $productsInfo);
         $tp->assign('user_group_product_user_number', $user_group_product_user_number);
         $tp->assign('form_fields', $edit_user_group_form->getFormFieldsInfo());
     } else {
         $errors['USER_GROUP_SID_NOT_SET'] = 1;
     }
     $tp->assign('user_group_info', isset($user_group_info) ? $user_group_info : null);
     $tp->assign('errors', $errors);
     $tp->assign('object_sid', $user_group_sid);
     $tp->display('edit_user_group.tpl');
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:59,代码来源:edit_user_group.php


示例19: createInfoForCustomProduct

 public static function createInfoForCustomProduct($userSid, $productSid, $listingSid, $price, $name, $type)
 {
     $productName = SJB_ProductsManager::getProductNameBySid($productSid);
     $userGroupSid = SJB_UserManager::getUserGroupByUserSid($userSid);
     $productInfo = array('custom_item' => "{$name} ({$productName})", 'custom_info' => array('listing_id' => (int) $listingSid, 'type' => $type, 'extraDescription' => "({$productName})", 'productSid' => (int) $productSid), 'name' => $name, 'number_of_listings' => 1, 'QtyPeriod' => 1, 'price' => $price, 'pricing_type' => 'fixed', 'sid' => -1, 'product_type' => 'post_listings', 'user_group_sid' => $userGroupSid);
     $productInfo['serialized_extra_info'] = serialize($productInfo);
     return $productInfo;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:8,代码来源:ShoppingCart.php


示例20: deleteUserById

 public static function deleteUserById($id)
 {
     SJB_DB::query('UPDATE `users` SET `parent_sid` = 0 WHERE `parent_sid` = ?n', $id);
     SJB_DB::query('UPDATE `listings` SET `subuser_sid` = 0 WHERE `subuser_sid` = ?n', $id);
     $user = SJB_UserManager::getObjectBySID($id);
     SJB_Statistics::addStatistics('deleteUser', $user->getUserGroupSID(), $user->getSID());
     return parent::deleteObjectInfoFromDB('users', $id);
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:8,代码来源:UserDBManager.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SLA类代码示例发布时间:2022-05-23
下一篇:
PHP SJB_System类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap