Sindbad~EG File Manager
<?php
if (!defined('ABSPATH'))
die('Restricted Access');
class WPJOBPORTALcountryController {
private $_msgkey;
function __construct() {
self::handleRequest();
$this->_msgkey = WPJOBPORTALincluder::getJSModel('country')->getMessagekey();
}
function handleRequest() {
$layout = WPJOBPORTALrequest::getLayout('wpjobportallt', null, 'countries');
if (self::canaddfile($layout)) {
switch ($layout) {
case 'admin_countries':
WPJOBPORTALincluder::getJSModel('country')->getAllCountries();
break;
case 'admin_formcountry':
$id = WPJOBPORTALrequest::getVar('wpjobportalid');
WPJOBPORTALincluder::getJSModel('country')->getCountrybyId($id);
break;
default:
return;
}
$module = (wpjobportal::$_common->wpjp_isadmin()) ? 'page' : 'wpjobportalme';
$module = WPJOBPORTALrequest::getVar($module, null, 'country');
$module = wpjobportalphplib::wpJP_str_replace('wpjobportal_', '', $module);
wpjobportal::$_data['sanitized_args']['wpjobportal_nonce'] = esc_html(wp_create_nonce('wpjobportal_nonce'));
WPJOBPORTALincluder::include_file($layout, $module);
}
}
function canaddfile($layout) {
$nonce_value = WPJOBPORTALrequest::getVar('wpjobportal_nonce');
if ( wp_verify_nonce( $nonce_value, 'wpjobportal_nonce') ) {
if (isset($_POST['form_request']) && $_POST['form_request'] == 'wpjobportal')
return false;
elseif (isset($_GET['action']) && $_GET['action'] == 'wpjobportaltask')
return false;
else{
if(!is_admin() && strpos($layout, 'admin_') === 0){
return false;
}
return true;
}
}
}
function remove() {
$nonce = WPJOBPORTALrequest::getVar('_wpnonce');
if (! wp_verify_nonce( $nonce, 'wpjobportal_country_nonce') ) {
die( 'Security check Failed' );
}
if(!wpjobportal::$_common->wpjp_isadmin())
return false;
$ids = WPJOBPORTALrequest::getVar('wpjobportal-cb');
$result = WPJOBPORTALincluder::getJSModel('country')->deleteCountries($ids);
$msg = WPJOBPORTALMessages::getMessage($result, 'country');
WPJOBPORTALMessages::setLayoutMessage($msg['message'], $msg['status'],$this->_msgkey);
$url = esc_url_raw(admin_url("admin.php?page=wpjobportal_country&wpjobportallt=countries"));
wp_redirect($url);
die();
}
function publish() {
$nonce = WPJOBPORTALrequest::getVar('_wpnonce');
if (! wp_verify_nonce( $nonce, 'wpjobportal_country_nonce') ) {
die( 'Security check Failed' );
}
if(!wpjobportal::$_common->wpjp_isadmin())
return false;
$pagenum = WPJOBPORTALrequest::getVar('pagenum');
$ids = WPJOBPORTALrequest::getVar('wpjobportal-cb');
$result = WPJOBPORTALincluder::getJSModel('country')->publishUnpublish($ids, 1); // for publish
$msg = WPJOBPORTALMessages::getMessage($result, 'record');
WPJOBPORTALMessages::setLayoutMessage($msg['message'], $msg['status'],$this->_msgkey);
$url = esc_url_raw(admin_url("admin.php?page=wpjobportal_country&wpjobportallt=countries"));
if ($pagenum)
$url .= "&pagenum=" . $pagenum;
wp_redirect($url);
die();
}
function unpublish() {
$nonce = WPJOBPORTALrequest::getVar('_wpnonce');
if (! wp_verify_nonce( $nonce, 'wpjobportal_country_nonce') ) {
die( 'Security check Failed' );
}
if(!wpjobportal::$_common->wpjp_isadmin())
return false;
$pagenum = WPJOBPORTALrequest::getVar('pagenum');
$ids = WPJOBPORTALrequest::getVar('wpjobportal-cb');
$result = WPJOBPORTALincluder::getJSModel('country')->publishUnpublish($ids, 0); // for unpublish
$msg = WPJOBPORTALMessages::getMessage($result, 'record');
WPJOBPORTALMessages::setLayoutMessage($msg['message'], $msg['status'],$this->_msgkey);
$url = esc_url_raw(admin_url("admin.php?page=wpjobportal_country&wpjobportallt=countries"));
if ($pagenum)
$url .= "&pagenum=" . $pagenum;
wp_redirect($url);
die();
}
function savecountry() {
$nonce = WPJOBPORTALrequest::getVar('_wpnonce');
if (! wp_verify_nonce( $nonce, 'wpjobportal_country_nonce') ) {
die( 'Security check Failed' );
}
if(!wpjobportal::$_common->wpjp_isadmin())
return false;
$data = WPJOBPORTALrequest::get('post');
$result = WPJOBPORTALincluder::getJSModel('country')->storeCountry($data);
$url = esc_url_raw(admin_url("admin.php?page=wpjobportal_country&wpjobportallt=countries"));
$msg = WPJOBPORTALMessages::getMessage($result, 'country');
WPJOBPORTALMessages::setLayoutMessage($msg['message'], $msg['status'],$this->_msgkey);
wp_redirect($url);
die();
}
}
$WPJOBPORTALcountry = new WPJOBPORTALcountryController();
?>
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists