public function execute() { if (SJB_SubAdmin::getSubAdminSID()) { $tp = SJB_System::getTemplateProcessor(); $tp->assign('subadmin', SJB_SubAdmin::getSubAdminInfo()); $tp->display('subadmin_left_menu.tpl'); } }
public function execute() { $type = 'subadmin'; $role = SJB_SubAdmin::getSubAdminSID(); // get new defined permissions for notification letter $acl = SJB_SubAdminAcl::getInstance(); $permissions = SJB_SubAdminAcl::getAllPermissions($type, $role); $resources = $acl->getResources(); SJB_SubAdminAcl::mergePermissionsWithResources($resources, $permissions); $tp = SJB_System::getTemplateProcessor(); $tp->assign('permissions', $resources); $tp->assign('admin_email', SJB_Settings::getSettingByName('notification_email')); $tp->display('../miscellaneous/subadmin-error.tpl'); }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $this->pageID = SJB_PageManager::getPageParentURI(SJB_Navigator::getURI(), SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE'), false); if (empty($this->pageID) || $this->pageID == '/') { $this->pageID = $GLOBALS['uri']; } if (SJB_SubAdmin::getSubAdminSID()) { $tp->assign('left_admin_menu', $this->mark_active_itemsPermissionWith($GLOBALS['LEFT_ADMIN_MENU'], SJB_SubAdminAcl::getInstance(), SJB_SubAdmin::getSubAdminSID())); $tp->assign('subadmin', SJB_SubAdmin::getSubAdminInfo()); } else { $tp->assign('left_admin_menu', $this->mark_active_items($GLOBALS['LEFT_ADMIN_MENU'])); } $tp->display('admin_left_menu.tpl'); }
public function execute() { $GLOBALS['LEFT_ADMIN_MENU']['Listing Configuration'] = array(array('title' => 'Common Fields', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-fields/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-fields/'), 'perm_label' => 'manage_common_listing_fields'), array('title' => 'Listing Types', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-types/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-type/', SJB_System::getSystemsettings('SITE_URL') . '/add-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/delete-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/posting-pages/', SJB_System::getSystemsettings('SITE_URL') . '/attention-listing-type-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing-field/edit-fields/'), 'perm_label' => array('manage_listing_types_and_specific_listing_fields', 'set_posting_pages'))); $listingTypes = SJB_ListingTypeManager::getAllListingTypesInfo(); usort($listingTypes, function ($listingType) { return $listingType['id'] == 'Job' || $listingType['id'] == 'Resume' ? true : false; }); $listingTypes = array_reverse($listingTypes); foreach ($listingTypes as $listingType) { if (!in_array($listingType['id'], array('Resume', 'Job'))) { $title = "'{$listingType['name']}' Listings"; $link = strtolower($listingType['id']) . '-listings/'; $permLabel = strtolower($listingType['id']) . '_listings'; } else { $title = "{$listingType['name']}s"; $link = strtolower($listingType['id']) . 's/'; $permLabel = strtolower($listingType['id']) . 's'; } $manageListings[] = array('title' => 'Manage ' . $title, 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-' . $link, 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-listing/', SJB_System::getSystemsettings('SITE_URL') . '/edit-listing/', SJB_System::getSystemsettings('SITE_URL') . '/display-listing/', SJB_System::getSystemsettings('SITE_URL') . '/manage-pictures/', SJB_System::getSystemsettings('SITE_URL') . '/edit-picture/'), 'perm_label' => 'manage_' . $permLabel); } $listingsManagement = array(array('title' => 'Import Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-listings/', 'highlight' => array(), 'perm_label' => 'import_listings'), array('title' => 'Export Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-listings/', 'highlight' => array(), 'perm_label' => 'export_listings'), array('title' => 'XML Feeds', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listing-feeds/', 'highlight' => array(), 'perm_label' => 'set_xml_feeds'), array('title' => 'XML Import', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/show-import/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-import/', SJB_System::getSystemsettings('SITE_URL') . '/edit-import/', SJB_System::getSystemsettings('SITE_URL') . '/run-import/'), 'perm_label' => 'set_xml_import'), array('title' => 'Flagged Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/flagged-listings/', 'highlight' => array(), 'perm_label' => 'manage_flagged_listings')); $GLOBALS['LEFT_ADMIN_MENU']['Listing Management'] = array_merge($manageListings, $listingsManagement); $userGroup = array(array('title' => 'User Groups', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/user-groups/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/delete-user-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile/', SJB_System::getSystemsettings('SITE_URL') . '/add-user-profile-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-location-fields/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-tree/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-list/', SJB_System::getSystemsettings('SITE_URL') . '/edit-user-profile-field/edit-list-item/', SJB_System::getSystemsettings('SITE_URL') . '/system/users/acl/'), 'perm_label' => array('manage_user_groups', 'manage_user_groups_permissions'))); $userGroups = SJB_UserGroupManager::getAllUserGroupsInfo(); $manageUsers = array(); foreach ($userGroups as $userGroups) { $userGroupId = mb_strtolower($userGroups['id'], 'utf8'); if (in_array($userGroups['id'], array('JobSeeker', 'Employer'))) { $name = "{$userGroups['name']}s"; } else { $name = "'{$userGroups['name']}' Users"; } $link = 'manage-users/' . $userGroupId . '/'; $manageUsers[] = array('title' => "Manage {$name}", 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/' . $link, 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/edit-user/', SJB_System::getSystemsettings('SITE_URL') . '/add-user/', SJB_System::getSystemsettings('SITE_URL') . '/manage-users/', SJB_System::getSystemsettings('SITE_URL') . '/email-log/', SJB_System::getSystemsettings('SITE_URL') . '/user-products/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-main/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-inbox/', SJB_System::getSystemsettings('SITE_URL') . '/private-messages/pm-outbox/', SJB_System::getSystemsettings('SITE_URL') . '/system/applications/view/', SJB_System::getSystemsettings('SITE_URL') . '/system/users/acl/'), 'perm_label' => 'manage_' . $userGroupId); } $GLOBALS['LEFT_ADMIN_MENU']['Users'] = array_merge($userGroup, $manageUsers); $users = array(array('title' => 'Import Users', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-users/', 'highlight' => array(), 'perm_label' => 'import_users'), array('title' => 'Export Users', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-users/', 'highlight' => array(), 'perm_label' => 'export_users'), array('title' => 'Mass Mailing', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/mailing/', 'highlight' => array(), 'perm_label' => 'create_and_send_mass_mailings'), array('title' => 'Guest Email Alerts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/guest-alerts/', 'highlight' => array(), 'perm_label' => 'manage_guest_email_alerts'), array('title' => 'Banned IPs', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/banned-ips/', 'perm_label' => 'manage_banned_ips')); $GLOBALS['LEFT_ADMIN_MENU']['Users'] = array_merge($GLOBALS['LEFT_ADMIN_MENU']['Users'], $users); $GLOBALS['LEFT_ADMIN_MENU']['Layout and Content'] = array(array('title' => 'Form Builder', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/form-builders/', 'perm_label' => 'edit_form_builder'), array('title' => 'System Templates', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-templates/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Email Templates', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-email-templates/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Themes', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/edit-themes/', 'perm_label' => 'edit_templates_and_themes'), array('title' => 'Site Pages', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/user-pages/', 'perm_label' => 'manage_site_pages'), array('title' => 'Static Content', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/stat-pages/', 'perm_label' => 'manage_static_content'), array('title' => 'Banners', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-banner-groups/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-banner-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-banner-group/', SJB_System::getSystemsettings('SITE_URL') . '/edit-banner/', SJB_System::getSystemsettings('SITE_URL') . '/add-banner/'), 'perm_label' => 'manage_banners'), array('title' => 'News', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/news-categories/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/manage-news/'), 'perm_label' => 'manage_news'), array('title' => 'Polls', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-polls/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/poll-answers/', SJB_System::getSystemsettings('SITE_URL') . '/poll-results/'), 'perm_label' => 'manage_polls')); $GLOBALS['LEFT_ADMIN_MENU']['Billing'] = array(array('title' => 'Invoices', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-invoices/', 'perm_label' => 'manage_invoices', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-invoice/', SJB_System::getSystemsettings('SITE_URL') . '/edit-invoice/')), array('title' => 'Products', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/products/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/edit-product/', SJB_System::getSystemsettings('SITE_URL') . '/add-product/'), 'perm_label' => 'manage_products'), array('title' => 'Promotions', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/promotions/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-promotion-code/', SJB_System::getSystemsettings('SITE_URL') . '/edit-promotion-code/', SJB_System::getSystemsettings('SITE_URL') . '/promotions/log/'), 'perm_label' => 'manage_promotions'), array('title' => 'Tax Rules', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-taxes/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-tax/', SJB_System::getSystemsettings('SITE_URL') . '/edit-tax/'), 'perm_label' => 'manage_tax_rules'), array('title' => 'Payment Gateways', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/system/payment/gateways/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/configure-gateway/'), 'perm_label' => 'manage_payment_gateways'), array('title' => 'Transaction History', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/payments/', 'perm_label' => 'transaction_history'), array('title' => 'Payment Log', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/payment-log/', 'perm_label' => 'payment_log')); $GLOBALS['LEFT_ADMIN_MENU']['Reports'] = array(array('title' => 'General Statistics', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/general-statistics/', 'perm_label' => 'general_statistics'), array('title' => 'Listings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/listings-statistics/', 'perm_label' => 'listings_reports'), array('title' => 'Applications and Views', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/applications-and-views/', 'perm_label' => 'applications_and_views_reports'), array('title' => 'Sales', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/sales/', 'perm_label' => 'sales_reports'), array('title' => 'Guest Alerts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/statistics/guest-alerts/', 'perm_label' => 'guest_alerts_reports'), array('title' => 'Promotions Usage', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/statistics/promotions/', 'perm_label' => 'promotions_statistics')); $GLOBALS['LEFT_ADMIN_MENU']['System Configuration'] = array(array('title' => 'System Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/settings/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/alphabet-letters/', SJB_System::getSystemsettings('SITE_URL') . '/view-error-log/'), 'perm_label' => 'configure_system_settings'), array('title' => 'Social Media', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/social-media/', 'perm_label' => 'social_media', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/social-media/bitly/', SJB_System::getSystemsettings('SITE_URL') . '/social-media/facebook', SJB_System::getSystemsettings('SITE_URL') . '/social-media/linkedin', SJB_System::getSystemsettings('SITE_URL') . '/social-media/twitter', SJB_System::getSystemsettings('SITE_URL') . '/social-media/googleplus')), array('title' => 'Admin Password', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/adminpswd/'), array('title' => 'Admin Sub Accounts', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-subadmins/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-subadmin/', SJB_System::getSystemsettings('SITE_URL') . '/edit-subadmin/')), array('title' => 'ZipCode Database', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/import-data/', SJB_System::getSystemsettings('SITE_URL') . '/geographic-data/edit-location/'), 'perm_label' => 'edit_zipcode_database'), array('title' => 'Countries', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/countries/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-country/', SJB_System::getSystemsettings('SITE_URL') . '/import-countries/', SJB_System::getSystemsettings('SITE_URL') . '/edit-country/'), 'perm_label' => 'manage_countries'), array('title' => 'States/Regions', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/states/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-state/', SJB_System::getSystemsettings('SITE_URL') . '/edit-state/', SJB_System::getSystemsettings('SITE_URL') . '/import-states/'), 'perm_label' => 'manage_states_or_regions'), array('title' => 'Manage Currencies', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/currency-list/', 'perm_label' => 'manage_currencies'), array('title' => 'Refine Search Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/refine-search-settings/', 'perm_label' => 'set_refine_search_parameters'), array('title' => 'Flag Listing Settings', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/flag-listing-settings/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/flag/', SJB_System::getSystemsettings('SITE_URL') . '/flag/'), 'perm_label' => 'edit_flag_listing_settings'), array('title' => 'Breadcrumbs Config', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-breadcrumbs/', 'perm_label' => 'configure_breadcrumbs'), array('title' => 'HTML filters', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/filters/', 'perm_label' => 'set_html_filters'), array('title' => 'Task Scheduler', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/task-scheduler-settings/', 'perm_label' => 'set_task_scheduler'), array('title' => 'Plugins', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/system/miscellaneous/plugins/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/system/miscellaneous/fb_app_settings/'), 'perm_label' => array('manage_plug-ins', 'set_phpbb_plug-in', 'set_facebook_plug-in', 'set_linkedin_plug-in', 'set_twitter_plug-in', 'set_wordpress_plug-in', 'set_sharethisplugin', 'set_captchaplugin', 'set_indeedplugin', 'set_jujuplugin', 'set_simplyhiredplugin', 'set_googleplugin', 'set_googleplusplugin', 'set_googleanalyticsplugin', 'set_beyondplugin')), array('title' => 'Backup/Restore', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/backup/', 'perm_label' => 'create_and_restore_backups'), array('title' => 'Email Log', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/email-log/', 'perm_label' => 'email_log')); $GLOBALS['LEFT_ADMIN_MENU']['Language Management'] = array(array('title' => 'Manage Languages', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-languages/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-language/', SJB_System::getSystemsettings('SITE_URL') . '/edit-language/'), 'perm_label' => 'manage_languages'), array('title' => 'Translate Phrases', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/manage-phrases/', 'highlight' => array(SJB_System::getSystemsettings('SITE_URL') . '/add-phrase/'), 'perm_label' => 'translate_phrases'), array('title' => 'Import Language', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/import-language/', 'perm_label' => 'import_languages'), array('title' => 'Export Language', 'reference' => SJB_System::getSystemsettings('SITE_URL') . '/export-language/', 'perm_label' => 'export_languages')); // set subadmin mode if (SJB_SubAdmin::getSubAdminSID()) { $GLOBALS['subadmin_id'] = SJB_SubAdmin::getSubAdminSID(); } }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $errors = array(); $form_submitted = SJB_Request::getVar('action'); $page = SJB_Request::getVar('page'); if ($form_submitted) { if (SJB_System::getSystemSettings("isDemo")) { $errors[] = "You don't have permissions for it. This is a Demo version of the software."; } else { if (!empty($_REQUEST['bad_words'])) { $_REQUEST['bad_words'] = trim($_REQUEST['bad_words']); } SJB_Settings::updateSettings($_REQUEST); } if ($form_submitted == 'apply_settings') { $tp->assign("page", $page); } } $i18n = SJB_I18N::getInstance(); $tp->assign("settings", SJB_Settings::getSettings()); $ds = DIRECTORY_SEPARATOR; $path = SJB_BASE_DIR . "system{$ds}cache{$ds}agents_bots.txt"; $disable_bots = file_get_contents($path); $tp->assign("disable_bots", $disable_bots); $tp->assign("timezones", timezone_identifiers_list()); if (!SJB_SubAdmin::getSubAdminSID()) { $tp->assign("subadmins", SJB_SubAdminManager::getAllSubAdminsInfo()); } $tp->assign("errors", $errors); $tp->assign("i18n_domains", $i18n->getDomainsData()); $tp->assign("i18n_languages", $i18n->getActiveLanguagesData()); $tp->assign("countries", SJB_CountriesManager::getAllCountriesCodesAndNames()); $tp->assign('listingEmailTemplates', SJB_EmailTemplateEditor::getEmailTemplatesByGroup(SJB_NotificationGroups::GROUP_ID_LISTING)); $tp->assign('productEmailTemplates', SJB_EmailTemplateEditor::getEmailTemplatesByGroup(SJB_NotificationGroups::GROUP_ID_PRODUCT)); $tp->assign('userEmailTemplates', SJB_EmailTemplateEditor::getEmailTemplatesByGroup(SJB_NotificationGroups::GROUP_ID_USER)); $tp->assign('otherEmailTemplates', SJB_EmailTemplateEditor::getEmailTemplatesByGroup(SJB_NotificationGroups::GROUP_ID_OTHER)); $tp->display("settings.tpl"); }
/** * get SJB_Function instance by function name and module name * * @param $script_filename * @param $function_name * @param $module_name * @param SJB_Acl $acl * @param array $params * $param int $aclRoleID * @return SJB_Function */ public function getFunction($function_name, $module_name, $params = array()) { $aclRoleID = null; $adminAccessType = SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == SJB_System::getSystemSettings('ADMIN_ACCESS_TYPE'); $accessTypePrefix = $adminAccessType ? 'Admin_' : ''; if ($adminAccessType && SJB_SubAdmin::admin_authed()) { $aclRoleID = SJB_SubAdmin::getSubAdminSID(); $acl = SJB_SubAdminAcl::getInstance(); } else { $acl = SJB_Acl::getInstance(); $cu = SJB_UserManager::getCurrentUser(); if (!empty($cu) && $cu->isSubuser()) { $cu = $cu->getSubuserInfo(); $aclRoleID = SJB_Array::get($cu, 'sid'); } } $functionPart = $this->getCamelCaseName($function_name); $modulePart = $this->getCamelCaseName($module_name); $className = 'SJB_' . $accessTypePrefix . $modulePart . '_' . $functionPart; return new $className($acl, $params, $aclRoleID); }
public static function init() { SJB_DB::init(SJB_System::getSystemSettings('DBHOST'), SJB_System::getSystemSettings('DBUSER'), SJB_System::getSystemSettings('DBPASSWORD'), SJB_System::getSystemSettings('DBNAME')); ini_set('zlib.output_compression', SJB_System::getSettingByName('gzip_compression')); $GLOBALS['fatal_error_reserve_buffer'] = str_repeat('x', 1024 * 200); ob_start(array('SJB_Error', 'fatalErrorHandler')); SJB_Session::init(SJB_System::getSystemSettings('SITE_URL')); $sessionId = SJB_DB::queryValue("SELECT `session_id` FROM `user_session_data_storage` WHERE `session_id` = ?s", SJB_Session::getSessionId()); // if not updated (row not exists) - insert that value if (empty($sessionId)) { SJB_DB::query("INSERT INTO `user_session_data_storage` SET `last_activity` = NOW(), `session_id` = ?s", SJB_Session::getSessionId()); } else { SJB_DB::query("UPDATE `user_session_data_storage` SET `last_activity` = NOW() WHERE `session_id` = ?s", $sessionId); } //set timezone if (SJB_Settings::getSettingByName('timezone')) { ini_set('date.timezone', SJB_Settings::getSettingByName('timezone')); } // Set Error Handler and Shutdown function set_error_handler(array('SJB_Error', 'errorHandler')); register_shutdown_function(array('SJB_System', 'shutdownFunction')); SJB_System::prepareGlobalArrays(); SJB_System::setGlobalTemplateVariable('is_ajax', SJB_Request::isAjax()); SJB_System::setGlobalTemplateVariable('site_url', SJB_System::getSystemSettings('SITE_URL')); SJB_System::setGlobalTemplateVariable('user_site_url', SJB_System::getSystemSettings('USER_SITE_URL')); SJB_System::setGlobalTemplateVariable('admin_site_url', SJB_System::getSystemSettings('ADMIN_SITE_URL')); SJB_System::setGlobalTemplateVariable('radius_search_unit', SJB_System::getSettingByName('radius_search_unit')); SJB_System::setGlobalTemplateVariable('settings', SJB_Settings::getSettings()); ThemeManager::getCurrentTheme(); SJB_PluginManager::loadPlugins(SJB_System::getSystemSettings('PLUGINS_DIR')); SJB_System::setGlobalTemplateVariable('plugins', SJB_PluginManager::getAllPluginsList()); $GLOBALS['System']['MODULE_MANAGER'] = new SJB_ModuleManager(); SJB_Event::dispatch('moduleManagerCreated'); $GLOBALS['System']['MODULE_MANAGER']->executeModulesStartupFunctions(); // define if subadmin loged in and set subamdinmode for templates if (SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE') == SJB_System::getSystemSettings('ADMIN_ACCESS_TYPE') && SJB_SubAdmin::getSubAdminSID()) { SJB_System::setGlobalTemplateVariable('subAdminSID', SJB_SubAdmin::getSubAdminSID()); } $GLOBALS['uri'] = SJB_Navigator::getURI(); }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $subAdminSID = SJB_SubAdmin::getSubAdminSID(); if (!empty($subAdminSID) && ($adminInfo = SJB_SubAdmin::getSubAdminInfo())) { // save sub admin notifications via ajax; SJB_SubAdminManager::SaveSubAdminNotifications($subAdminSID, SJB_Request::getVar('name', ''), SJB_Request::getVar('value')); $message = ''; $editedSubAdminInfo = $_REQUEST; $subAdminNewInfo = array_merge($adminInfo, $editedSubAdminInfo); // create subAdmin object $oSubAdmin = SJB_ObjectMother::createSubAdmin($subAdminNewInfo); $oSubAdmin->setSID($adminInfo['sid']); $oSubAdmin->makePropertyNotRequired("username"); $oSubAdmin->makePropertyNotRequired("email"); $oSubAdmin->makePropertyNotRequired("password"); $oSubAdmin->addProperty(array('id' => 'password_cur', 'caption' => 'Current Password', 'type' => 'password', 'length' => '20', 'is_system' => true, 'order' => 1)); $oSubAdmin->setPropertyValue('password_cur', SJB_Request::getVar('password_cur', '')); // permissions $acl = SJB_SubAdminAcl::getInstance(); $type = 'subadmin'; $resources = $acl->getResources(); $perms = SJB_SubAdminAcl::getAllPermissions($type, $oSubAdmin->getSID()); // /permissions SJB_SubAdminAcl::mergePermissionsWithResources($resources, $perms); $errors = array(); $action = SJB_Request::getVar('action', ''); if ('save' == $action) { $registration_form = SJB_ObjectMother::createForm($oSubAdmin); $registration_form->registerTags($tp); if ($adminInfo['email'] == $subAdminNewInfo['email']) { $oSubAdmin->deleteProperty('email'); } $password_value = $oSubAdmin->getPropertyValue('password'); if (!empty($password_value['original'])) { $currentPass = $oSubAdmin->getPropertyValue('password_cur'); if (!empty($currentPass)) { if (!SJB_SubAdmin::checkCurrentPassword($currentPass)) { $oSubAdmin->deleteProperty('password'); $errors['CurrentPassword'] = '******'; } } else { $oSubAdmin->deleteProperty('password'); $errors['CurrentPassword'] = '******'; } } else { $oSubAdmin->deleteProperty('password'); } $oSubAdmin->deleteProperty('password_cur'); if (empty($errors) && $registration_form->isDataValid($errors)) { SJB_SubAdminManager::saveSubAdmin($oSubAdmin); SJB_HelperFunctions::redirect(SJB_System::getSystemSettings('SITE_URL') . '/edit-profile/?saved=1'); } } $oSubAdmin->deleteProperty('password'); $oSubAdmin->deleteProperty('password_cur'); $oSubAdmin->addProperty(array('id' => 'password_cur', 'caption' => 'Current Password', 'type' => 'password_cur', 'length' => '20', 'is_system' => true, 'order' => 1)); $oSubAdmin->addProperty(array('id' => 'password', 'caption' => 'New Password', 'type' => 'password', 'length' => '20', 'is_system' => true, 'order' => 1)); $registration_form = SJB_ObjectMother::createForm($oSubAdmin); $registration_form->registerTags($tp); $registration_form->makeDisabled('username'); $tp->assign("saved", SJB_Request::getVar('saved', false)); $tp->assign("errors", $errors); $tp->assign("form_fields", $registration_form->getFormFieldsInfo()); $tp->assign('groups', SJB_SubAdminAcl::getPermissionGroups()); $tp->assign('notifications', SJB_SubAdminAcl::getSubAdminNotifications($resources, $perms)); $tp->assign('resources', $resources); $tp->assign('type', $type); $tp->assign('sid', $subAdminNewInfo['sid']); $tp->assign('message', $message); $tp->display("edit_subadmin_profile.tpl"); } }
public function execute() { $tp = SJB_System::getTemplateProcessor(); $saved = false; $action = SJB_Request::getVar('action'); $form_submitted = SJB_Request::getVar('submit'); $template = 'plugins.tpl'; $errors = array(); if (SJB_Request::getVar('error', false)) { $errors[] = SJB_Request::getVar('error', false); } $messages = array(); if (SJB_Request::getVar('message', false)) { $messages[] = SJB_Request::getVar('message', false); } switch ($action) { case 'save': $paths = SJB_Request::getVar('path'); $active = SJB_Request::getVar('active'); $subAdminSID = SJB_SubAdmin::getSubAdminSID(); if (SJB_System::getSystemSettings('isDemo')) { $errors[] = 'You don\'t have permissions for it. This is a Demo version of the software.'; } else { foreach ($paths as $key => $path) { $config = SJB_PluginManager::getPluginConfigFromIniFile($path); // check subadmins permissions if ($subAdminSID) { switch ($key) { case 'FacebookSocialPlugin': if (!$this->acl->isAllowed('set_facebook_plug-in', $subAdminSID)) { continue 2; } break; case 'LinkedinSocialPlugin': if (!$this->acl->isAllowed('set_linkedin_plug-in', $subAdminSID)) { continue 2; } break; case 'PhpBBBridgePlugin': if (!$this->acl->isAllowed('set_phpbb_plug-in', $subAdminSID)) { continue 2; } break; case 'TwitterIntegrationPlugin': if (!$this->acl->isAllowed('set_twitter_plug-in', $subAdminSID)) { continue 2; } break; case 'WordPressBridgePlugin': if (!$this->acl->isAllowed('set_wordpress_plug-in', $subAdminSID)) { continue 2; } break; case 'ShareThisPlugin': if (!$this->acl->isAllowed('set_sharethisplugin', $subAdminSID)) { continue 2; } break; case 'CaptchaPlugin': if (!$this->acl->isAllowed('set_captchaplugin', $subAdminSID)) { continue 2; } break; case 'IndeedPlugin': if (!$this->acl->isAllowed('set_indeedplugin', $subAdminSID)) { continue 2; } break; case 'JujuPlugin': if (!$this->acl->isAllowed('set_jujuplugin', $subAdminSID)) { continue 2; } break; case 'SimplyHiredPlugin': if (!$this->acl->isAllowed('set_simplyhiredplugin', $subAdminSID)) { continue 2; } break; case 'GoogleAnalyticsPlugin': if (!$this->acl->isAllowed('set_googleanalyticsplugin', $subAdminSID)) { continue 2; } break; case 'BeyondPlugin': if (!$this->acl->isAllowed('set_beyondplugin', $subAdminSID)) { continue 2; } break; } } $config['active'] = $active[$key]; $saved = SJB_PluginManager::savePluginConfigIntoIniFile($path, $config); if (!$saved) { $errors[] = 'Failed to save ' . $key . ' settings'; } } } SJB_PluginManager::reloadPlugins(); break; case 'save_settings': $request = $_REQUEST; $request = self::checkRequiredFields($request); if (!isset($request['setting_errors'])) { SJB_Settings::updateSettings($request); if ($form_submitted == 'save') { break; } else { if ($form_submitted == 'apply') { $pluginName = SJB_Request::getVar('plugin'); SJB_HelperFunctions::redirect('?action=settings&plugin=' . $pluginName); } } } else { unset($request['setting_errors']); $errors = $request; } case 'settings': $pluginName = SJB_Request::getVar('plugin'); $plugin = SJB_PluginManager::getPluginByName($pluginName); if (isset($plugin['name'])) { $pluginObj = new $plugin['name'](); $settings = $pluginObj->pluginSettings(); $template = 'plugin_settings.tpl'; $savedSettings = SJB_Settings::getSettings(); SJB_Event::dispatch('RedefineSavedSetting', $savedSettings, true); SJB_Event::dispatch('RedefineTemplateName', $template, true); $tp->assign('plugin', $plugin); $tp->assign('settings', $settings); $tp->assign('savedSettings', $savedSettings); } break; case 'editCaptcha': $info = $_REQUEST; SJB_Event::dispatch('editCaptcha', $info, true); foreach ($info as $key => $val) { $tp->assign($key, $val); } $template = $info['template']; break; } $listPlugins = SJB_PluginManager::getAllPluginsList(); $plugins = array(); foreach ($listPlugins as $key => $plugin) { $group = !empty($plugin['group']) ? $plugin['group'] : 'Common'; $plugins[$group][$key] = $plugin; if (array_key_exists($key, $this->socialMediaPlugins)) { $plugins[$group][$key]['socialMedia'] = $this->socialMediaPlugins[$key]; } } $tp->assign('saved', $saved); $tp->assign('groups', $plugins); $tp->assign('errors', $errors); $tp->assign('messages', $messages); $tp->display($template); }