本文整理汇总了PHP中SJB_UserManager::getCurrentUserSID方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_UserManager::getCurrentUserSID方法的具体用法?PHP SJB_UserManager::getCurrentUserSID怎么用?PHP SJB_UserManager::getCurrentUserSID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_UserManager
的用法示例。
在下文中一共展示了SJB_UserManager::getCurrentUserSID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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");
}
}
示例2: 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');
}
示例3: 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');
}
}
示例4: 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');
}
示例5: 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');
}
}
示例6: 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;
}
}
示例7: getPropertyVariablesToAssign
function getPropertyVariablesToAssign()
{
$profile_field_as_dv = '';
if (isset($this->property_info['profile_field_as_dv']) && $this->property_info['profile_field_as_dv'] != '') {
$profile_field_as_dv = SJB_UserManager::getSystemPropertyValueByObjectSID('users', SJB_UserManager::getCurrentUserSID(), $this->property_info['profile_field_as_dv']);
}
return array('id' => $this->property_info['id'], 'useAutocomplete' => $this->property_info['use_autocomplete'], 'type' => $this->property_info['type'], 'isClassifieds' => $this->property_info['is_classifieds'], 'value' => $this->property_info['value'], 'default_value' => $this->property_info['default_value'], 'profile_field_as_dv' => $profile_field_as_dv);
}
示例8: execute
public function execute()
{
$tp = SJB_System::getTemplateProcessor();
if (SJB_UserManager::isUserLoggedIn()) {
$user_id = SJB_UserManager::getCurrentUserSID();
$unread = SJB_PrivateMessage::getCountUnreadMessages($user_id);
$tp->assign('unread', $unread);
$tp->assign('include', '');
}
$tp->display('main.tpl');
}
示例9: jsRate
private function jsRate()
{
if (!SJB_UserManager::isUserLoggedIn()) {
exit;
}
$listing_sid = SJB_Request::getInt('listing', 0, SJB_Request::METHOD_POST);
$rate = SJB_Request::getInt('rate', 0, SJB_Request::METHOD_POST);
$new_rating = SJB_Rating::setRaiting($rate, $listing_sid, SJB_UserManager::getCurrentUserSID());
if (isset($new_rating['rating'])) {
echo $new_rating['rating'];
}
}
示例10: execute
public function execute()
{
$template_processor = SJB_System::getTemplateProcessor();
$listingId = SJB_Request::getVar('listing_id', null, 'default', 'int');
$listingType = SJB_Request::getVar('listing_type', null);
if (!$listingType) {
if ($listingId) {
$listingInfo = SJB_ListingManager::getListingInfoBySID($listingId);
$listingType = SJB_ListingTypeManager::getListingTypeIDBySID($listingInfo['listing_type_sid']);
} else {
$listingType = 'job';
}
}
$displayForm = SJB_Request::getVar('displayForm', false);
$error = null;
if (!SJB_Acl::getInstance()->isAllowed('save_' . trim($listingType))) {
$error = 'DENIED_SAVE_LISTING';
}
if (SJB_UserManager::isUserLoggedIn()) {
if (!$error) {
if (!is_null($listingId)) {
if (SJB_UserManager::isUserLoggedIn()) {
SJB_SavedListings::saveListingOnDB($listingId, SJB_UserManager::getCurrentUserSID());
SJB_Statistics::addStatistics('saveListing', SJB_ListingTypeManager::getListingTypeSIDByID($listingType), $listingId);
} else {
SJB_SavedListings::saveListingInCookie($listingId);
}
$template_processor->assign('saved_listing', SJB_SavedListings::getSavedListingsByUserAndListingSid(SJB_UserManager::getCurrentUserSID(), $listingId));
} else {
$error = 'LISTING_ID_NOT_SPECIFIED';
}
}
$params = SJB_Request::getVar('params', false);
$searchId = SJB_Request::getVar('searchId', false);
$page = SJB_Request::getVar('page', false);
$template_processor->assign("params", $params);
$template_processor->assign("searchId", $searchId);
$template_processor->assign("page", $page);
$template_processor->assign("listing_type", $listingType);
$template_processor->assign("listing_sid", $listingId);
$template_processor->assign("from_login", SJB_Request::getVar("from_login", false));
$template_processor->assign("error", $error);
$template_processor->assign("displayForm", $displayForm);
$template_processor->assign("view", SJB_Request::getVar('view'));
$template_processor->display("save_listing.tpl");
} else {
$template_processor->assign("return_url", base64_encode(SJB_Navigator::getURIThis() . "&from_login=1"));
$template_processor->assign("ajaxRelocate", true);
$template_processor->display("../users/login.tpl");
}
}
示例11: execute
public function execute()
{
$listing_id = SJB_Request::getVar('listing_id', null);
$listing_info = SJB_ListingManager::getListingInfoBySID($listing_id);
$field_id = SJB_Request::getVar('field_id', null);
$current_user_sid = SJB_UserManager::getCurrentUserSID();
$owner_sid = SJB_ListingManager::getUserSIDByListingSID($listing_id);
$errors = array();
$complexEmun = SJB_Request::getVar('complexEnum', null, 'GET');
$complexFieldID = SJB_Request::getVar('complexParent', null, 'GET');
if (!is_null($complexEmun) && !is_null($complexFieldID)) {
$fieldArr = array();
array_push($fieldArr, $complexFieldID);
array_push($fieldArr, $field_id);
array_push($fieldArr, $complexEmun);
$field_id = $complexFieldID . ':' . $field_id . $complexEmun . '_' . $listing_id;
} else {
$fieldArr = explode(':', $field_id);
$complexEmun = isset($fieldArr[2]) ? explode('_', $fieldArr[2]) : false;
$complexEmun = $complexEmun ? $complexEmun[0] : false;
}
if (is_null($listing_id) || is_null($field_id)) {
$errors['PARAMETERS_MISSED'] = 1;
} else {
if (is_null($listing_info) || $complexEmun === false || !isset($listing_info[$fieldArr[0]][$fieldArr[1]][$complexEmun])) {
$errors['WRONG_PARAMETERS_SPECIFIED'] = 1;
} else {
if ($owner_sid != $current_user_sid) {
$errors['NOT_OWNER'] = 1;
} else {
$uploaded_file_id = $listing_info[$fieldArr[0]][$fieldArr[1]][$complexEmun];
SJB_UploadFileManager::deleteUploadedFileByID($uploaded_file_id);
$listing_info[$field_id] = '';
$listing = new SJB_Listing($listing_info, $listing_info['listing_type_sid']);
$props = $listing->getProperties();
foreach ($props as $prop) {
if ($prop->getID() !== $field_id) {
$listing->deleteProperty($prop->getID());
}
}
$listing->setSID($listing_id);
SJB_ListingManager::saveListing($listing);
}
}
}
$tp = SJB_System::getTemplateProcessor();
$tp->assign('errors', $errors);
$tp->assign('listing_id', $listing_id);
$tp->display('delete_uploaded_file.tpl');
}
示例12: execute
public function execute()
{
$tp = SJB_System::getTemplateProcessor();
if (SJB_UserManager::isUserLoggedIn()) {
$userSID = SJB_UserManager::getCurrentUserSID();
$action = SJB_Request::getVar('pm_action', null);
if ($action) {
$checked = SJB_Request::getVar('pm_check', array(), 'POST');
switch ($action) {
case 'delete':
SJB_PrivateMessage::deleteContact($userSID, $checked);
break;
case 'save_contact':
$error = '';
$contactSID = SJB_Request::getInt('user_id', 0);
SJB_PrivateMessage::saveContact($userSID, $contactSID, $error);
$tp->assign('error', $error);
$tp->display('contact_save.tpl');
return true;
break;
default:
break;
}
}
$page = SJB_Request::getInt('page', 1, 'GET');
$contactsPerPage = SJB_Request::getInt('contactsPerPage', 10);
SJB_PrivateMessage::deleteNonexistentContacts($userSID);
$total = SJB_PrivateMessage::getTotalContacts($userSID);
$totalPages = ceil($total / $contactsPerPage);
if ($totalPages == 0) {
$totalPages = 1;
}
if (empty($page) || $page <= 0) {
$page = 1;
}
if ($totalPages < $page) {
SJB_HelperFunctions::redirect("?page={$totalPages}");
}
$tp->assign('message_list', SJB_PrivateMessage::getContacts($userSID, $page, $contactsPerPage));
$tp->assign('contactsPerPage', $contactsPerPage);
$tp->assign('page', $page);
$tp->assign('totalPages', $totalPages);
$tp->assign('include', 'contacts.tpl');
$tp->assign('unread', SJB_PrivateMessage::getCountUnreadMessages($userSID));
}
$tp->display('main.tpl');
}
示例13: invoiceValidation
/**
* @param $invoice
* @return bool
*/
private function invoiceValidation($invoice)
{
if ($invoice instanceof SJB_Invoice) {
if (SJB_UserManager::getCurrentUserSID() != $invoice->getUserSID()) {
SJB_FlashMessages::getInstance()->addError('NOT_OWNER');
return false;
} else {
if ($invoice->getStatus() == SJB_Invoice::INVOICE_STATUS_PAID) {
SJB_FlashMessages::getInstance()->addError('INVOICE_ALREADY_PAID');
return false;
}
}
} else {
SJB_FlashMessages::getInstance()->addError('NOT_VALID_PAYMENT_ID');
return false;
}
return true;
}
示例14: _get_Captions_with_Counts_Grouped_by_Captions
protected function _get_Captions_with_Counts_Grouped_by_Captions($request_data, array $listingSids = array())
{
$items = array();
if (!empty($request_data[$this->field['field']]['tree'])) {
$this->parent = $items = explode(',', $request_data[$this->field['field']]['tree']);
$treeValues = $this->tree_values;
$this->tree_values = array();
}
if (SJB_Settings::getValue('enableBrowseByCounter')) {
$request_data['access_type'] = array('accessible' => SJB_UserManager::getCurrentUserSID());
$criteria = SJB_SearchFormBuilder::extractCriteriaFromRequestData($request_data);
$sqlTranslator = new SJB_SearchSqlTranslator('listings');
$whereStatement = $sqlTranslator->_getWhereStatement($criteria);
$sql = "`{$this->field['field']}` != ''";
if (count($items) > 1) {
$sql = " AND (";
foreach ($items as $key => $item) {
if ($key == 0) {
$sql .= " FIND_IN_SET('{$item}',`{$this->field['field']}`) ";
} else {
$sql .= " OR FIND_IN_SET('{$item}',`{$this->field['field']}`) ";
}
if (isset($treeValues[$item])) {
$this->tree_values[$item] = $treeValues[$item];
}
}
$sql .= ")";
}
if (!empty($listingSids)) {
$sql .= ' AND `listings`.`sid` IN (' . implode(',', $listingSids) . ')';
}
$sql = "SELECT `?w` AS caption, `sid` AS object_sid FROM `listings` {$whereStatement} AND {$sql}";
$result = SJB_DB::query($sql, $this->field['field']);
$result = self::_getCountsByItems($result);
} else {
if (count($items) > 1) {
foreach ($items as $item) {
$this->tree_values[$item] = $treeValues[$item];
}
}
$result = self::getTreeItems($this->tree_values, SJB_ListingFieldTreeManager::getTreeDepthBySID($this->field['sid']));
}
return $result;
}
示例15: execute
public function execute()
{
$tp = SJB_System::getTemplateProcessor();
$action = SJB_Request::getVar('action', 'list');
$sid = SJB_Request::getVar('sid', null, null, 'int');
if (SJB_Acl::getInstance()->isAllowed('use_screening_questionnaires')) {
switch ($action) {
case 'delete':
if (SJB_ScreeningQuestionnaires::isUserOwnerQuestionnaire(SJB_UserManager::getCurrentUserSID(), $sid)) {
SJB_ScreeningQuestionnaires::deleteQuestionnaireBySID($sid);
}
$action = 'list';
break;
}
$tp->assign('questionnaires', SJB_ScreeningQuestionnaires::getList(SJB_UserManager::getCurrentUserSID()));
$tp->assign('action', $action);
$tp->display('screening_questionnaires.tpl');
}
}