public static function getTableEdit() { $SKTDB = \CmsDev\Sql\db_Skt::connect(); $Language = \CmsDev\Language\CheckLanguage::get(); $query = $SKTDB->get_row("SELECT AdminParams FROM language WHERE Prefix = '" . $Language . "'"); if ($query->AdminParams != '') { $params = json_decode($query->AdminParams, true); if (is_array($params)) { $HTML = '<table><tr><td>Parametro</td><td>Valor</td></tr>'; foreach ($params as $variable => $value) { if (!is_array($value)) { $HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $value . '</td></tr>'; } else { $NewvalueToArray = \json_encode($value); $HTML .= '<tr><td>SKT_ADMIN_' . $variable . '</td><td>' . $NewvalueToArray . '</td></tr>'; } } $HTML .= '</table>'; return $HTML; } else { $ErrorMessageBox = "Error al cargar las variables de sistema en CmsDev\\Language\\getParams(). Puede existir un json mal formado. Verifique la tabla de lenguaje o consulte al Administrador."; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError($ErrorMessageBox, true); // //$AdminParams=substr($query->AdminParams,strrpos($query->AdminParams,"\"")-200,200); //echo "<pre>".$AdminParams."</pre>"; } } else { self::setParamsFromFile(); } }
function __construct() { $MessageBox = \CmsDev\Info\Asistance::get(); if (Login::action('validateAdmin') === true) { require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '/SKTEditor.php'; require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '/Layout/EditorLayouts.php'; require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '/CRUD/Xtras/ColectorData.php'; } }
private function validateMD5($MD5 = 0) { $SKTDB = SKT_DB::connect(); $user = $SKTDB->get_row("SELECT * FROM users WHERE md5 = " . \GetSQLValueString($MD5, 'text') . ""); if ($user) { $updateSectionImage = mysql_query(sprintf("UPDATE users Set \r\n\t\t\t\t\t\t\tisactive = %s\r\n\t\t\t\t\t\t\tWHERE md5 = %s", GetSQLValueString(1, "int"), GetSQLValueString($MD5, "text"))); return true; } else { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError('No se pudo validar el usuario.<br>' . $MD5, true); return false; } }
function __construct() { if (Login::action('validateAdmin') === true) { $DS = DIRECTORY_SEPARATOR; $app = \file_get_contents(dirname(dirname(__FILE__)) . $DS . '_appjs' . $DS . 'app.js'); $appPack = new \CmsDev\JavaScriptPacker($app); $SKTFSys = \file_get_contents(dirname(dirname(__FILE__)) . $DS . '_appjs' . $DS . 'SKTFSys.js'); $SKTFSysPack = new \CmsDev\JavaScriptPacker($SKTFSys); echo '<script type="text/javascript">' . $appPack->pack() . $SKTFSysPack->pack() . '</script>'; $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->Render(); } }
public function GetDataSet() { $user_row = self::UserQuery(); if ($user_row) { $this->Company = $user_row->Company; $this->email = $user_row->email; $this->user_list = $user_row; $this->user = $user_row; $this->UserOk = true; } else { $this->UserOk = false; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true); } }
public function GetDataSet() { $SKTDB = SKT_DB::connect(); $USER_EXIST = \CmsDev\Security\loginIntent::action('validateUser'); if ($USER_EXIST === true) { $user_list = $SKTDB->get_row("SELECT *\r\n FROM users as user join userprofile as profile \r\n ON user.md5 = " . \GetSQLValueString($_SESSION['login'], 'int') . "\r\n WHERE user.id = profile.IDX \r\n "); if ($user_list) { $this->user_list = $user_list; $this->UserOk = true; } else { $this->UserOk = false; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true); } } else { $this->UserOk = false; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT, true); } }
public function Render($CC = '', $CCParams = array(), $file = 'Control.php', $location = 0, $CCID = false) { global $SKT; if ($file !== '') { $this->file = $file; } else { } $this->file = isset($file) && $file !== '' ? $file : 'Control.php'; $this->location = isset($location) && $location !== '' ? $location : 0; $SKTDB = SKT_DB::connect(); $this->CC = self::urlResolve($CC); if ($this->location === 0) { $this->location = \SKTPATH_TemplateSite . 'SKT_Controls' . \DS . $CC . \DS . $this->file; } $this->location = self::urlResolve($this->location); if ($CCID !== false) { $contentIDZone = $SKTDB->get_results("SELECT * FROM " . \DB_PREFIX . "content WHERE ID = '" . GetSQLValueString($CCID, "int") . "'"); $query = $SKTDB->get_col_info($info_type = "name", $col_offset = -1); $cols = array(); foreach ($query as $name) { array_push($cols, $name); } foreach ($contentIDZone as $Zone) { $this->TitleZone[$CCID] = \utf8_decode($Zone->Title); $this->CSSZone[$CCID] = \utf8_decode($Zone->css_class); $this->CustomPropertyZone[$CCID] = \utf8_decode($Zone->CustomProperty); } } if (\is_file($this->location)) { include $this->location; } else { if ($SKT['DEBUG'] === 1) { echo '<span style="color:red"><i class="skt-icon-error"></i> "' . $this->CC . '"</span>'; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError('<i class="skt-icon-frown" style="font-size: 2em; vertical-align: sub;"></i> <b>No se encuentra el control</b>: "' . $CC . '" en ' . \LOCAL_DIR . $this->location, true); } } }
public static function render() { $SectionValues = \CmsDev\Content\Section::get(); $Template = $SectionValues->Template; if ($Template === '') { $Template = 'home'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOAD SEARCH ENGINE -------------------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here == 'Google_Search') { $Template = 'System/Google_Search'; $LoadTemplate = \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/Google_Search.php'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOGIN AS ADMINISTRATOR ---------------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here === 'admin' or \SKTURL_Here === 'admin?invalid-admin' or \SKTURL_Here === 'admin') { if (isset($_POST['SKT_AdminName']) && isset($_POST['SKT_AdminPassword'])) { $checkAction = \CmsDev\Security\loginIntent::checkAction('Admin'); } $Template = 'System/admin'; } if (isset($_GET['invalid-admin'])) { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_Invalid, true); $Template = 'System/admin'; } if (\THIS_URL_REAL === 'CloseAdmin') { $checkAction = \CmsDev\Security\loginIntent::checkAction('close'); exit; } /* ------------------------------------------------------------------------------- */ /* ------------------------- USERS, LOGIN, REGISTER, CONNECT -------------------- */ /* ------------------------------------------------------------------------------- */ if (\SKTURL_Here === 'UserProfile') { $Template = 'System/Profile'; } if (\SKTURL_Here === 'UserRegistration') { $Template = 'System/NewUser'; } if (\SKTURL_Here === 'PasswordRecovery') { $Template = 'System/PasswordRecovery'; } if (\SKTURL_Here === 'UserLogin' || \THIS_URL_REAL == 'UserLogin?invalid-user') { $Template = 'System/user'; } if (\SKTURL_Here === 'ValidateUser') { $Template = 'System/ValidateUser'; } if (\SKTURL_Here === 'UserLogout') { $checkAction = \CmsDev\Security\loginIntent::checkAction('close'); exit; } if (\SKTURL_Here === 'index.php' || \THIS_URL_REAL === '?logout') { \CmsDev\Header\refresh::refreshNow(\SERVER_DIR); exit; } if (\THIS_URL_REAL === 'login_with_facebook') { \CmsDev\Header\refresh::refreshNow(\SERVER_DIR . '?login_with_facebook'); exit; } if (isset($_POST['SKT_UserName']) && isset($_POST['SKT_Password'])) { \CmsDev\Security\loginIntent::checkAction('login'); } if (isset($_GET['invalid-user'])) { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_Invalid, true); } if (defined("error")) { if (\error == 'error500') { $Template = 'System/500'; } elseif (\error == 'error404') { $Template = 'System/404'; } elseif (\error == 'error403') { $Template = 'System/403'; } } if (isset($_GET['usr'])) { $Template = 'System/Company'; } if (isset($_GET['empresas'])) { $Template = 'Empresas'; } if (isset($_GET['Detail'])) { $Template = 'System/Detail'; } if (isset($_GET['Type']) && $_GET['Type'] == 'Search') { $Template = 'System/Search'; $LoadTemplate = \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/Search.php'; } /* ------------------------------------------------------------------------------- */ /* ------------------------- LOAD DYNAMIC SECTION ------------------------------ */ /* ------------------------------------------------------------------------------- */ if (!isset($_GET['SKTGoTo']) && !isset($_GET['SKTFiles']) && !isset($_GET['SKTDir']) && !isset($_GET['SKTFiles']) && !isset($_GET['SKTFSys'])) { if (\is_file(\SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php')) { include \SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php'; } else { echo \SKTPATH_TemplateSite . 'SKT_Theme_Pages/' . $Template . '.php'; include \SKTPATH_TemplateSite . 'SKT_Theme_Pages/System/500.php'; } } }
<?php if (\is_dir(SKTPATH_TemplateSite)) { require_once SKTPATH_TemplateSite . '/head.php'; echo '<body class="' . $SKT['BODY']['CLASS'] . '" style="' . $SKT['BODY']['STYLE'] . '" id="' . $SKT['BODY']['ID'] . '"><div class="ui-widget-overlay"></div>'; require_once SKTPATH_TemplateSite . '/body.php'; echo '<div class="skt SKTNotRemove">'; new \CmsDev\Security\LoadEditorRequired(); $MessageBox = \CmsDev\Info\Asistance::get(); echo $MessageBox->Render(); echo '</div><div id="loader-wrapper" class="load_hide"><div id="loader"></div></div>'; echo '</body>'; } else { require_once '/_TemplateSite/defaultSite/head.php'; echo '<body><div class="ui-widget-overlay"></div>'; require_once '/_TemplateSite/defaultSite/body.php'; echo '<div class="skt SKTNotRemove">'; new \CmsDev\Security\LoadEditorRequired(); $MessageBox = \CmsDev\Info\Asistance::get(); echo $MessageBox->Render(); echo '</div>'; echo '</body>'; } //echo '<script>setTimeout(function(){var links=document.getElementsByTagName("a");if(links.length){for(var i=0;i<=links.length-1;i++){var thisLink=document.getElementsByTagName("a")[i];if(thisLink.hasAttribute("href")){var thishref=document.getElementsByTagName("a")[i].getAttribute("href");if(thishref=="#"){document.getElementsByTagName("a")[i].setAttribute("href","javascript:void(0);")}else{if(thishref.charAt(0)=="#"){document.getElementsByTagName("a")[i].setAttribute("href",document.URL+thishref)}}}}}},1000);</script>'; echo '</html>';
private static function MakeNewUser($Client = false, $Info = array(), $LevelType = 'Customers') { $SKTDB = \CmsDev\Sql\db_Skt::connect(); $new_Google = false; $new_Facebook = false; $CheckUserName = new \CmsDev\util\CheckUserName(); $username = Code::Charset(isset($Info['username']) ? $Info['username'] : ''); $password = md5(isset($Info['password']) ? $Info['password'] : ''); $email = Code::Charset(isset($Info['email']) ? $Info['email'] : ''); $isactive = isset($Info['isactive']) ? $Info['isactive'] : 0; $activekey = isset($Info['activekey']) ? $Info['activekey'] : 0; $resetkey = isset($Info['resetkey']) ? $Info['resetkey'] : 0; $cust_no = isset($Info['cust_no']) ? $Info['cust_no'] : 0; $md5 = isset($Info['md5']) ? $Info['md5'] : md5($username) . $password; $Description = isset($Info['Description']) ? $Info['Description'] : ''; $Lat = isset($Info['Lat']) ? $Info['Lat'] : '-35'; $Lon = isset($Info['Lon']) ? $Info['Lon'] : '-54'; $zoom = isset($Info['zoom']) ? $Info['zoom'] : '12'; $Type = isset($Info['Type']) ? $Info['Type'] : $LevelType; $website = isset($Info['website']) ? $Info['website'] : ''; $ViewHelp = isset($Info['ViewHelp']) ? $Info['ViewHelp'] : 0; $token = isset($Info['token']) ? $Info['token'] : ''; $Company = isset($Info['Company']) ? $Info['Company'] : $Info["username"]; $CompanyUrl = isset($Info['CompanyUrl']) ? $Info['CompanyUrl'] : $CheckUserName->Fix($username); $Level = isset($Info['level']) ? $Info['level'] : $Type; $RUT = isset($Info['RUT']) ? $Info['RUT'] : ''; $Position = isset($Info['Position']) ? $Info['Position'] : ''; $Name = isset($Info['Name']) ? $Info['Name'] : ''; $Surname = isset($Info['Surname']) ? $Info['Surname'] : ''; $Country = isset($Info['Country']) ? $Info['Country'] : ''; $City = isset($Info['City']) ? $Info['City'] : ''; $CP = isset($Info['CP']) ? $Info['CP'] : ''; $Address = isset($Info['Address']) ? $Info['Address'] : ''; $From = isset($Info['From']) ? $Info['From'] : '09'; $To = isset($Info['To']) ? $Info['To'] : '18'; $Phone = isset($Info['Phone']) ? $Info['Phone'] : ''; $payment_method = isset($Info['payment_method']) ? $Info['payment_method'] : ''; $ClientAuth = isset($Info['ClientAuth']) ? $Info['ClientAuth'] : ''; $ClientAuth_id = isset($Info['ClientAuth_id']) ? $Info['ClientAuth_id'] : ''; $ClientAuth_link = isset($Info['ClientAuth_link']) ? $Info['ClientAuth_link'] : ''; $ClientAuth_name = isset($Info['ClientAuth_name']) ? $Info['ClientAuth_name'] : ''; $ClientAuth_family_name = isset($Info['ClientAuth_family_name']) ? $Info['ClientAuth_family_name'] : ''; $ClientAuth_given_name = isset($Info['ClientAuth_given_name']) ? $Info['ClientAuth_given_name'] : ''; $ClientAuth_email = isset($Info['ClientAuth_email']) ? $Info['ClientAuth_email'] : ''; $ClientAuth_picture = isset($Info['ClientAuth_picture']) ? $Info['ClientAuth_picture'] : ''; $ClientAuth_locale = isset($Info['ClientAuth_locale']) ? $Info['ClientAuth_locale'] : ''; $ClientAuth_gender = isset($Info['ClientAuth_gender']) ? $Info['ClientAuth_gender'] : ''; $category1 = isset($Info['category1']) ? $Info['category1'] : ''; $category2 = isset($Info['category2']) ? $Info['category2'] : ''; $category3 = isset($Info['category3']) ? $Info['category3'] : ''; $category4 = isset($Info['category4']) ? $Info['category4'] : ''; $category5 = isset($Info['category5']) ? $Info['category5'] : ''; if ($Client == 'FromGoogle') { /* ----------------------------------------------------------------------/// FromGoogle ///-------------- */ $Name = $Info['name']; $Surname = $Info['family_name']; $ClientAuth = $Info['ClientAuth']; $ClientAuth_id = $Info['id']; $ClientAuth_link = $Info['link']; $ClientAuth_name = $Info['name']; $ClientAuth_family_name = $Info['family_name']; $ClientAuth_given_name = $Info['given_name']; $ClientAuth_email = $Info['email']; $ClientAuth_picture = $Info['picture']; $ClientAuth_locale = $Info['locale']; $ClientAuth_gender = $Info['gender']; $username = Code::Encode($Info['given_name']); $password = md5($Info['id']); $email = $Info['email']; $isactive = 1; $md5 = md5($username . $password); $Company = $Info['name']; $CompanyUrl = $CheckUserName->Fix($Info['name']); $Type = 'Customers'; $user_listQuery = "SELECT *\r\n FROM users as user, userprofile as profile\r\n WHERE user.id = profile.IDX AND profile.ClientAuth = 'Google' AND profile.ClientAuth_id = " . \GetSQLValueString($Info["id"], 'text') . ""; $user_list = $SKTDB->get_row($user_listQuery); $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipInfo('<b>' . $Name . '.</b><br><pre>' . $user_listQuery . '</pre><pre>' . $user_list->username . '</pre>', false); if ($user_list) { $_SESSION['UserName'] = $user_list->username; $session = md5($user_list->username . $user_list->password); $_SESSION['login'] = $session; $_SESSION['UserIDU'] = $user_list->id; $new_Google = false; $header = \SERVER_DIR; \CmsDev\Header\refresh::refreshNow(\SITE_SERVER); exit; } else { $new_Google = true; } /* ------------------------------------------------------------------------------------------------------ */ } else { if ($Client == 'FromFacebook') { /* --------------------------------------------------------------------/// FromFacebook ///-------------- */ /* ------------------------------------------------------------------------------------------------------ */ } else { } } if ($Client == 'FromSite' || $new_Google == true || $new_Facebook == true) { if ($username != '' || !isset($_SESSION['login'])) { $test = $SKTDB->get_var("SELECT id FROM users WHERE username = "******""); if (!$test) { $insertUserQuery = "INSERT INTO users \r\n ( username, password, email, CompanyUrl, isactive, activekey, resetkey, cust_no, Lat, Lon, zoom, md5, Type ) \r\n\t\t\tVALUES (" . GetSQLValueString($username, "text") . "," . GetSQLValueString($password, "text") . "," . GetSQLValueString($email, "text") . "," . GetSQLValueString($CompanyUrl, "text") . "," . GetSQLValueString($isactive, "int") . "," . GetSQLValueString($activekey, "int") . "," . GetSQLValueString($resetkey, "int") . "," . GetSQLValueString($cust_no, "int") . "," . GetSQLValueString($Lat, "text") . "," . GetSQLValueString($Lon, "text") . "," . GetSQLValueString($zoom, "int") . "," . GetSQLValueString($md5, "text") . "," . GetSQLValueString($Type, "text") . ")"; $insertUser = $SKTDB->query($insertUserQuery); if ($insertUser) { $FotoPerfil = ''; $insertUserID = $SKTDB->insert_id; if (!isset($Info['FotoPerfil']) || $Info['picture'] === '') { $FotoPerfil = \SKT_ACCESS_AVATAR; } else { $FotoPerfil = $Info['FotoPerfil']; } if ($new_Google == true) { $FotoPerfil = $ClientAuth_picture; } $insertProfile = $SKTDB->query("INSERT INTO userprofile \r\n (IDX, level, Name, Surname, Company, RUT, Position, Country, City, CP, Address, eFrom, eTo, Phone, payment_method, \r\n ClientAuth,ClientAuth_id,ClientAuth_link,ClientAuth_name,ClientAuth_family_name,ClientAuth_given_name,ClientAuth_email,ClientAuth_picture,ClientAuth_locale, ClientAuth_gender)\r\n VALUES (" . GetSQLValueString($insertUserID, "int") . "," . GetSQLValueString($Level, "text") . "," . GetSQLValueString(Code::Charset($Name), "text") . "," . GetSQLValueString(Code::Charset($Surname), "text") . "," . GetSQLValueString(Code::Charset($Company), "text") . "," . GetSQLValueString(Code::Charset($RUT), "text") . "," . GetSQLValueString(Code::Charset($Position), "text") . "," . GetSQLValueString(Code::Charset($Country), "text") . "," . GetSQLValueString(Code::Charset($City), "text") . "," . GetSQLValueString(Code::Charset($CP), "text") . "," . GetSQLValueString(Code::Charset($Address), "text") . "," . GetSQLValueString(Code::Charset($From), "text") . "," . GetSQLValueString(Code::Charset($To), "text") . "," . GetSQLValueString(Code::Charset($Phone), "text") . "," . GetSQLValueString(Code::Charset($payment_method), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_id), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_link), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_family_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_given_name), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_email), "text") . "," . GetSQLValueString(Code::Charset($FotoPerfil), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_locale), "text") . "," . GetSQLValueString(Code::Charset($ClientAuth_gender), "text") . ")"); if ($LevelType == 'Publishers' || $Type == 'Publishers' || $Level == 'Publishers') { $date = date('Y-m-d'); $Date_FinishBuild = strtotime('+ 182 day', strtotime($date)); $Date_Finish = date('Y-m-d', $Date_FinishBuild); $query = "INSERT INTO user_plan (UID,Limit_Plan,planID,Date_Finish) " . "VALUES (" . GetSQLValueString($insertUserID, "int") . "," . GetSQLValueString("180", "int") . "," . GetSQLValueString("99", "int") . "," . GetSQLValueString($Date_Finish, "date") . ")"; $SKTDB->query($query); } if ($insertProfile) { if ($Client == 'FromSite') { $ValidateUserMail = new \CmsDev\Security\ValidateUserMail(); echo $ValidateUserMail->User($insertUserID); } if ($new_Google == true || $new_Facebook == true) { $_SESSION['UserName'] = $ClientAuth_id; $session = md5($username . $password); $_SESSION['login'] = $session; $_SESSION['UserIDU'] = $insertUserID; \CmsDev\Header\refresh::refreshNow(SITE_SERVER); exit; } } else { $error = "error"; } } else { $error = \SKT_ADMIN_User_Invalid; } } } } if ($error != '') { $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError('<b>' . $Name . '.</b> - ' . $error . ', <pre>' . $username . '</pre>', false); } }
private function routes() { $SKT = \CmsDev\util\globals::getVar('SKT'); $HTTP = "http://" . $_SERVER['HTTP_HOST']; $bbase = $this->CorrectURL(basename($_SERVER['SCRIPT_FILENAME'])); $LOC = $this->CorrectURL(str_replace($bbase, "", $_SERVER['SCRIPT_FILENAME'])); $this->ThisURL = str_replace($bbase, "", $_SERVER['PHP_SELF']); $this->ThisDIR = str_replace($bbase, "", $_SERVER['SCRIPT_FILENAME']); define("SERVER_DIR", $HTTP); define('LOCAL_DIR', $this->fixDS($LOC)); define('LOCAL_FILESYSTEM', $this->fixDS($LOC . '_FileSystems' . DIRECTORY_SEPARATOR)); $Request = new \CmsDev\Url\Request(); $allRequest = \trim($Request->all(), '/'); if ($allRequest == '') { \define('SUBURL', $allRequest . \LANGUAGE_DEF); } else { \define('SUBURL', $allRequest); } $ThisSectionURLName = $Request->byLevel(0); \define('THIS_URL_REAL', $ThisSectionURLName); $TotalURL = $Request->all(); \define('TOTAL_REQUEST', \SERVER_DIR . $TotalURL); \define('LOCAL_FILESYSTEM_SECTION', $this->fixDS(\LOCAL_FILESYSTEM . \SUBURL) . DIRECTORY_SEPARATOR); \define('URL_VERSION', 'CmsDev/' . \SKT_VERSION . '/'); if (!\is_dir(\LOCAL_DIR . '/_TemplateSite/' . \SKT_TEMPLATE)) { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('Se está mostrando el template por defecto, ya que no se encontró el directorio "<b>' . \SKT_TEMPLATE . '</b>"'); $TemplateCustom = 'defaultSite'; \define('SKT_TEMPLATE_ERROR', 'ERROR: Se está mostrando el template por defecto.'); } else { \define('SKT_TEMPLATE_ERROR', ''); } //\define('SKTURL_TemplateSite', str_replace(\SUBSITE, '/', $SKT['URL']['SUBSITE'] . '_TemplateSite/' . $TemplateCustom)); \CmsDev\Layout\EditorLayoutsBox::get(); \define('SKTServerURL', \SUBSITE); \define('SKTImageSized', \SUBSITE . 'SKTSize/'); \define('SKTGoTo', \SUBSITE . 'SKTGoTo/'); $arr = array('LanguageFromFile' => \LanguageFromFile, 'SKTServerURL' => \SKTServerURL, 'SKTURL_Here' => \SKTURL_Here, 'SKTImageSized' => \SKTImageSized, 'SKTGoTo' => \SKTGoTo, 'SKTURL_REQUEST_URI' => \SKTURL_REQUEST_URI, 'SKTURL_REQUEST_PARAMS' => \SKTURL_REQUEST_PARAMS, 'VERSION' => \VERSION, 'SKT_TEMPLATE' => \SKT_TEMPLATE, 'SKTPATH' => \SKTPATH, 'SKTPATH_CmsDev' => \SKTPATH_CmsDev, 'SKTPATH_FileSystems' => \SKTPATH_FileSystems, 'SKTPATH_TemplateSite' => \SKTPATH_TemplateSite, 'SKTURL' => \SKTURL, 'SKTURL_CmsDev' => \SKTURL_CmsDev, 'SKTURL_FileSystems' => \SKTURL_FileSystems, 'SKTURL_TemplateSite' => \SKTURL_TemplateSite, 'SERVER_DIR' => \SERVER_DIR, 'LOCAL_DIR' => \LOCAL_DIR, 'LOCAL_FILESYSTEM' => \LOCAL_FILESYSTEM, 'LOCAL_FILESYSTEM_SECTION' => \LOCAL_FILESYSTEM_SECTION, 'TOTAL_REQUEST' => \TOTAL_REQUEST, 'SUBSITE' => $SKT['URL']['SUBSITE'], 'SUBURL' => $allRequest, 'THIS_URL_REAL' => $ThisSectionURLName, 'URL_VERSION' => \URL_VERSION, 'SKT_TEMPLATE_ERROR' => \SKT_TEMPLATE_ERROR); $this->DevShowParams .= '<h3><a href="#">Direcciones</a></h3><table width="250" border="0" cellspacing="0" cellpadding="0" class="TableInfo"><tr><th scope="row" class="defined">defined</th><td scope="row" class="value">value</td></tr>'; foreach ($arr as $variable => $value) { $this->DevShowParams .= '<tr><th class="defined"><span>' . $variable . '</span></th><th scope="row" class="value"><span>' . $value . '</span></th></tr>'; } $this->DevShowParams .= '</table>'; $GoTo = \SKTURL . 'SKTGoTo/'; $GoToURL = array('URL_CheckURLName' => 'CheckURLName', 'URL_CheckUserName' => 'CheckUserName', 'URL_QueryLanguage_Activate_Update' => 'CRUD/Language/Activate', 'URL_QuerySectionMeta' => 'CRUD/Section/SectionMeta', 'URL_QuerySectionData' => 'CRUD/Section/SectionData', 'URL_QueryContentProp' => 'CRUD/Contents/ContentProp', 'URL_Content_Add_Product' => 'CRUD/Product/Add', 'URL_Content_Edit_Product' => 'CRUD/Product/Edit', 'URL_Content_Add_Custom' => 'CRUD/CustomControl/Add', 'URL_Content_Edit_Custom' => 'CRUD/CustomControl/Edit', 'URL_Content_Add_Note' => 'CRUD/Note/Add', 'URL_Content_Edit_Note' => 'CRUD/Note/Edit', 'URL_Content_Add_Photo' => 'CRUD/Image/Add', 'URL_Content_Edit_Photo' => 'CRUD/Image/Edit', 'URL_FileSystemsPopUP' => 'AdminFilesystem/__FileSystemsPopUP', 'URL_QueryCreateContent' => 'Query/CreateContent', 'URL_QueryUpdateContent' => 'Query/UpdateContent', 'URL_QueryDeleteContent' => 'Query/DeleteContent', 'URL_Content_Edit_PlainText' => 'CRUD/PlainText/Edit', 'URL_Content_Edit_HTML' => 'CRUD/HTML/Edit', 'URL_QueryLoadPlainText' => 'Query/LoadPlainText', 'URL_QueryUpdateFileOrder' => 'Query/UpdateFileOrder', 'URL_QueryUpdateSectionProduct' => 'Query/UpdateSectionProduct', 'URL_QueryCreateSectionProduct' => 'Query/CreateSectionProduct', 'URL_View_List_Add_List' => 'CRUD/CustomList/Add_List', 'URL_View_List_SelectList' => 'CRUD/CustomList/SelectList', 'URL_Query_List_Add_List' => 'CRUD/CustomList/Add_List_query', 'URL_Query_Delete_List_query' => 'CRUD/CustomList/Delete_List_query', 'URL_View_List_Properties' => 'CRUD/CustomList/Properties', 'URL_Query_List_Edit_Properties' => 'CRUD/CustomList/Edit_Properties', 'URL_Query_Add_Item_query' => 'CRUD/CustomList/Add_Item_query', 'URL_Query_Edit_Item_query' => 'CRUD/CustomList/Edit_Item_query', 'URL_View_Add_Item' => 'CRUD/CustomList/Add_Item', 'URL_Query_Delete_Item_query' => 'CRUD/CustomList/Delete_Item_query', 'URL_Query_List_Edit_Item' => 'CRUD/CustomList/Edit_Item', 'URL_View_List_Items' => 'CRUD/CustomList/List_items', 'URL_View_List_Index' => 'CRUD/CustomList/index', 'URL_Edit_Item' => 'CRUD/CustomList/Edit_Item', 'URL_Link_Edit' => 'CRUD/Link/Edit', 'URL_Query_Link_Create' => 'Query/CreateLink', 'URL_Query_Link_Edit' => 'Query/EditLink', 'URL_Query_Link_Delete' => 'Query/DeleteLink', 'URL_View_List_Information' => 'CRUD/CustomList/List_Information', 'URL_ViewEditElementsAsList' => 'CRUD/ViewEditElementsAsList/index', 'URL_logs' => 'logs'); $GoToURLJS = ''; foreach ($GoToURL as $variable => $value) { \define($variable, $GoTo . self::uencsec($value)); $GoToURLJS .= 'var ' . $variable . '="' . $GoTo . self::uencsec($value) . '";'; } $GoToURLJS .= 'var PHARLOCATION ="' . \PHARLOCATION . '"; var LOCAL_FILESYSTEM ="' . $LOC . '_FileSystems/";'; \define('GoToURLJS', $GoToURLJS); \define('URL_SKTFSys', \SKTURL . 'SKTFSys/'); }
public static function render($IDZone, $NameZone = '', $StyleClass = '') { $IDZone = static::FixZone($IDZone); if ($NameZone === '') { $NameZone = static::FixZone($IDZone); } else { $NameZone = static::FixZone($NameZone); } $isLogged = SKT_SECURE::action('validateAdmin'); $SKTDB = SKT_DB::connect(); $IDSections = \SKT_SECTION_ID; $editorCMS = 0; $editorcss = ""; $editorCMS_WrapBefore = ""; $editorCMS_WrapAfter = ""; $editorScript_WrapBefore = ""; $editorScript_WrapAfter = ""; $total_lock_mod = 0; $_SESSION_View_DesignCMS = 0; $IDZoneColect = $IDZone . '|' . $NameZone . ','; $IDZoneColectObj = \CmsDev\Content\ZoneColect::init(); $IDZoneColectObj->set($IDZoneColect); $DS = DIRECTORY_SEPARATOR; if ($isLogged === true) { $editorCMS_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper"> <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"> <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a> <ul class=""> <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"> <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li> <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li> </li><li class="CmsDevEditCMS" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li> </ul> </div> </h3>'; $editorCMS_WrapAfter = '<div class="clear"></div></div>'; $editorScript_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper"> <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"> <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a> <ul class=""> <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li> <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li> <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li> <li class="CmsDevEditScript" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li> </ul> </div> </h3>'; $editorScript_WrapAfter = '<div class="clear"></div></div>'; $editorCC_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper"> <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"> <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a> <ul class=""> <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li> <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li> <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li> [FILES] [CUSTOMIZED] <li class="CmsDevEditCC" rel="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li> </ul> <form action="" method="post" style="display:none;"> <input name="Action" id="Action" type="hidden" value="[Action]" /> <input name="ID" type="hidden" value="[ID]" /> <input name="IDZone" type="hidden" value="[IDZone]" /> <input name="CCFromTemplate" id="CCFromTemplate" type="hidden" value="[CCFromTemplate]" /> <textarea name="CustomProperty" id="CustomProperty" />[CustomProperty]</textarea> </form> </div> </h3>'; $editorCC_WrapAfter = '<div class="clear"></div></div>'; $editorNote_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper"> <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"> <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a> <ul class=""> <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li> <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li> <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li> <li class="CmsDevEditNote" rel="[ID]" id="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li> </ul> </div> </h3>'; $editorNote_WrapAfter = '<div class="clear"></div></div>'; $editorPhoto_WrapBefore = '<div class="' . $editorcss . ' sktEditorContentWrapper"> <h3 class="EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"> <span class="Title">[TitleZone]</span><div class="CmsDevIcon"><a href="javascript:void(0);"></a> <ul class=""> <li class="Delete" rel="[ID]" title="' . SKT_ADMIN_Btn_Delete . '"></li> <li class="Recycle" rel="[ID]" title="' . SKT_ADMIN_Btn_Recycle . '"></li> <li class="Property" rel="[ID]" title="' . SKT_ADMIN_Btn_Properties . '"></li> <li class="CmsDevEditPhoto" rel="[ID]" id="[ID]" title="' . SKT_ADMIN_Btn_Edit . '"></li> </ul> </div> </h3>'; $editorPhoto_WrapAfter = '<div class="clear"></div></div>'; } if (isset($_POST['View_DesignCMS'])) { $_SESSION_View_DesignCMS = $_POST['View_DesignCMS']; $_SESSION['View_DesignCMS'] = $_SESSION_View_DesignCMS; } else { if (isset($_SESSION['View_DesignCMS'])) { $_SESSION_View_DesignCMS = $_SESSION['View_DesignCMS']; } else { $_SESSION_View_DesignCMS = 0; } } if ($isLogged === true) { $editorCMS = 1; $editorcss = " EditorContainer ui-corner-all EditorActive"; echo '<div class="ZoneContainer"><h4>' . $NameZone . '</h4></div>'; } $contentIDZoneCount = $SKTDB->get_var("SELECT count(*) FROM " . DB_PREFIX . "content WHERE (IDPage = '{$IDSections}' AND IDZone = '{$IDZone}') OR (IDZone = '{$IDZone}' AND AllPage = '1')"); if ($contentIDZoneCount >= 1) { $contentIDZone = $SKTDB->get_results("SELECT * FROM " . DB_PREFIX . "content WHERE (IDPage = '{$IDSections}' AND IDZone = '{$IDZone}') OR (IDZone = '{$IDZone}' AND AllPage = '1') ORDER BY Position ASC"); $query = $SKTDB->get_col_info($info_type = "name", $col_offset = -1); $cols = array(); foreach ($query as $name) { array_push($cols, $name); } foreach ($contentIDZone as $Zone) { if ($isLogged === true) { $DivWrapBefore = '<div id="E_' . $Zone->ID . '_' . $Zone->IDPage . '_' . $Zone->IDZone . '_' . $Zone->Date . '" rel="' . $Zone->Title . '" class="sktEditorContent ' . $StyleClass . ' ' . $Zone->css_class . '">'; if ($Zone->Type == 'html') { $editorSet = $editorCMS_WrapBefore; foreach ($cols as $col) { $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet); } $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet); if ($Zone->RecycleBin == 1) { $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet); $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore); } echo $editorSet . $DivWrapBefore; //$Zone->Content = str_replace("[[ZONA]]",LoadMod('CustomArea'.$Zone->ID.$Zone->IDZone),$Zone->Content); echo CS::Charset($Zone->Content); echo '</div>'; echo $editorCMS_WrapAfter; } if ($Zone->Type == 'Note') { $editorSet = $editorNote_WrapBefore; if ($Zone->CustomProperty != '') { if (\is_file(\SKTPATH_TemplateSite . $Zone->CustomProperty)) { $NoteTemplate = file_get_contents(\SKTPATH . $Zone->CustomProperty); } elseif (\is_file(\SKTPATH_TemplateSite . $DS . "SKT_Theme_Parts" . $DS . 'Notes' . $DS . $Zone->CustomProperty)) { $NoteTemplate = file_get_contents(\SKTPATH_TemplateSite . $DS . "SKT_Theme_Parts" . $DS . 'Notes' . $DS . $Zone->CustomProperty); } } if ($NoteTemplate != '') { $editorSet .= $NoteTemplate; } foreach ($cols as $col) { $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet); } $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet); if ($Zone->RecycleBin == 1) { $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet); $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore); } echo $editorSet . $DivWrapBefore; echo '</div>'; echo $editorNote_WrapAfter; } if ($Zone->Type == 'Photo') { $editorSet = $editorPhoto_WrapBefore; foreach ($cols as $col) { $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet); } $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet); if ($Zone->RecycleBin == 1) { $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet); $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore); } echo $editorSet . $DivWrapBefore; $fileprop = \SKTPATH_FileSystems . $Zone->CustomProperty; $file = str_replace("/SKTSize/", "", $fileprop); $file = str_replace("/", DIRECTORY_SEPARATOR, $file); $hiperlink = DataTag($file, 'hiperlink'); $title = DataTag($file, 'title'); $Description = DataTag($file, 'Description'); $urlSrc = $Zone->CustomProperty; $ThePhoto = ''; if ($hiperlink != '' && $hiperlink != 'null' && $hiperlink != 'undefined') { $ThePhoto .= '<a href="' . $hiperlink . '" title="' . $title . '" target="_blank">'; $ThePhoto .= '<img src="' . $urlSrc . '" alt="' . $title . '" class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>'; $ThePhoto .= '</a>'; } else { $ThePhoto .= '<img src="' . $urlSrc . '" alt="' . $title . '" class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>'; } if ($Description != '' && $Description != 'null' && $Description != 'undefined') { $ThePhoto = '<figure class="figureDescription">' . $ThePhoto . '</figure>'; } echo $ThePhoto; echo '</div>'; echo $editorPhoto_WrapAfter; } if ($Zone->Type == 'script') { $editorSet = $editorScript_WrapBefore; foreach ($cols as $col) { $editorSet = str_replace('[' . $col . ']', CS::Charset($Zone->{$col}), $editorSet); } $editorSet = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorSet); if ($Zone->RecycleBin == 1) { $editorSet = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorSet); $DivWrapBefore = str_replace("sktEditorContent ", "sktEditorContent SKTRecycled", $DivWrapBefore); } echo $editorSet . $DivWrapBefore; echo CS::Charset($Zone->Content); echo '</div>'; echo $editorScript_WrapAfter; } if ($Zone->Type == 'Anchor') { if ($Zone->RecycleBin == 1) { $editorScript_WrapBefore = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorScript_WrapBefore); } echo str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorScript_WrapBefore) . $DivWrapBefore; echo '<a name="' . CS::Charset($Zone->Content) . '" id="' . CS::Charset($Zone->Content) . '"></a>'; echo '</div>'; echo $editorScript_WrapAfter; } if ($Zone->Type == 'SKT_Controls') { $editorCCBeforeok_find = array("[TitleZone]", "[Action]", "[CustomProperty]", "[ID]", "[IDZone]", "[CCFromTemplate]"); $editorCCBeforeok_replace = array(CS::Charset($Zone->Title), CS::Charset($Zone->Custom), CS::Charset($Zone->CustomProperty), $Zone->ID, $Zone->IDZone, $Zone->CCFromTemplate); $editorCCBeforeRep = str_replace("[TitleZone]", CS::Charset($Zone->Title), $editorCC_WrapBefore); $editorCCBeforeok = str_replace($editorCCBeforeok_find, $editorCCBeforeok_replace, $editorCCBeforeRep); if ($Zone->RecycleBin == 1) { $editorCCBeforeok = str_replace("EditorHeaderTitle", "EditorHeaderTitle SKTRecycled", $editorCCBeforeok); } $find = strstr($Zone->Custom, 'File_'); $FilesGoTo = '[FILES]'; if ($find == true) { $FilesGoTo = '<li class="CmsDevEditFiles" title="' . SKT_ADMIN_Btn_Edit . '"></li>'; $editorCCBeforeok = str_replace("CmsDevEditCC", "CmsDevEditCCF", $editorCCBeforeok); } $editorCCBeforeok = str_replace("[FILES]", $FilesGoTo, $editorCCBeforeok); // $find2 = strstr($Zone->Custom, 'Folder_'); $FilesGoTo = ''; if ($find2 == true) { $FilesGoTo = '<li class="CmsDevEditFiles" title="' . SKT_ADMIN_Btn_Edit . '"></li>'; $editorCCBeforeok = str_replace("CmsDevEditCC", "CmsDevEditCCF", $editorCCBeforeok); } $editorCCBeforeok = str_replace("[FILES]", $FilesGoTo, $editorCCBeforeok); // $find3 = strstr($Zone->Custom, 'Customized_'); $FilesGoTo = '[CUSTOMIZED]'; if ($find3 == true) { $FilesGoTo = '<li class="CmsDevEditCCCustomized" title="' . SKT_ADMIN_Btn_Edit . '"></li>'; //$editorCCBeforeok = str_replace("CmsDevEditCC","CmsDevEditCCCustomized",$editorCCBeforeok); $editorCCBeforeok = str_replace("[CUSTOMIZED]", $FilesGoTo, $editorCCBeforeok); } $editorCCBeforeok = str_replace("[CUSTOMIZED]", '', $editorCCBeforeok); // echo $editorCCBeforeok . '<div id="E_' . $Zone->ID . '_' . $Zone->IDPage . '_' . $Zone->IDZone . '_' . $Zone->Date . '" rel="' . $Zone->Title . '" class="SKT_Controls ' . $Zone->css_class . '" ><div class="CustomProperty">' . $Zone->CustomProperty . '</div>'; if ($Zone->CCFromTemplate == '') { if (\is_file(\SKTPATH . '/SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') { include \SKTPATH . '/SKT_Controls/' . $Zone->Custom . '/Control.php'; } else { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('No se encuentra el control nativo en: ' . $Zone->Custom . '/Control.php', false); echo 'No se encuentra el control ' . $Zone->Custom; } } else { if (\is_file(\SKTPATH_TemplateSite . '/SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') { include \SKTPATH_TemplateSite . '/SKT_Controls/' . $Zone->Custom . '/Control.php'; //echo "OKIDOKI"; } else { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('No se encuentra el control personalizado en: ' . $Zone->CCFromTemplate . $Zone->Custom . '/Control.php', false); echo 'No se encuentra el control personalizado ' . $Zone->Custom; } } echo '</div>'; echo $editorCC_WrapAfter; } } else { if ($Zone->RecycleBin == 0) { if ($Zone->Type == 'SKT_Controls') { if ($Zone->Title != '') { echo '<h3 class="TitleControl"><span>' . CS::Charset($Zone->Title) . '</span></h3>'; } echo '<div class="' . $StyleClass . ' SKT_Controls">'; if ($Zone->CCFromTemplate == '') { if (\is_file(\SKTPATH . '/SKT_Controls/' . 'SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') { include \SKTPATH . 'SKT_Controls/' . 'SKT_Controls/' . $Zone->Custom . '/Control.php'; } else { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('No se encuentra el control nativo en: ' . $Zone->CCFromTemplate . $Zone->Custom . '/Control.php', false); echo 'No se encuentra el control ' . $Zone->Custom; } } else { if (\is_file(\SKTPATH_TemplateSite . 'SKT_Controls/' . $Zone->Custom . '/Control.php') && SKT_TEMPLATE_ERROR === '') { include \SKTPATH_TemplateSite . 'SKT_Controls/' . $Zone->Custom . '/Control.php'; } else { $MessageBox = \CmsDev\Info\Asistance::get(); $MessageBox->TipError('No se encuentra el control personalizado en: ' . \SKTPATH_TemplateSite . $Zone->Custom . '/Control.php', false); echo 'No se encuentra el control ' . $Zone->Custom; } } echo '</div>'; } elseif ($Zone->Type == 'Anchor') { echo '<h3 class="Anchor EditorHeaderTitle ui-dialog-titlebar ui-widget-header ui-corner-all"><a name="' . CS::Charset($Zone->Content) . '" id="' . CS::Charset($Zone->Content) . '"></a>' . CS::Charset($Zone->Title) . '<div class="ui-state-default ui-corner-all ScrollTop" onclick="javascript:$.scrollTo(\'#ScrollTop\',800);"><div class="ui-icon ui-icon-circle-arrow-n "></div></div></h3>'; } elseif ($Zone->Type == 'Note') { if ($Zone->CustomProperty != '') { $NoteTemplate = file_get_contents($Zone->CustomProperty); } $note_find = array("[Title]", "[Content]", "[Date]", "[Autor]", "[CssClass]"); $note_replace = array(CS::Charset($Zone->Title), CS::Charset($Zone->Content), $Zone->Date, CS::Charset($Zone->Autor), CS::Charset($Zone->css_class)); $note = str_replace($note_find, $note_replace, $NoteTemplate); echo $note; } elseif ($Zone->Type == 'Photo') { $file = \SKT_URL_BASE . '/' . $Zone->CustomProperty; $file = str_replace("//", "/", $file); $hiperlink = DataTag($file, 'hiperlink'); $title = DataTag($file, 'title'); $Description = DataTag($file, 'Description'); $ThePhoto = ''; if ($hiperlink != '' && $hiperlink != 'null' && $hiperlink != 'undefined') { $ThePhoto .= '<a href="' . $hiperlink . '" title="' . $title . '" target="_blank">'; $ThePhoto .= '<img src="' . $Zone->CustomProperty . '" alt="' . $title . '" class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>'; $ThePhoto .= '</a>'; } else { $ThePhoto .= '<img src="' . $Zone->CustomProperty . '" alt="' . $title . '" class="img-responsive ' . $StyleClass . '"/><span class="hidden Description">' . $Description . '</span>'; } if ($Description != '' && $Description != 'null' && $Description != 'undefined') { $ThePhoto = '<figure class="figureDescription">' . $ThePhoto . '</figure>'; } echo $ThePhoto; } else { if ($Zone->Title != '') { echo '<h3 class="TitleControl"><span>' . CS::Charset($Zone->Title) . '</span></h3>'; } echo '<div class="sktEditorContent ' . CS::Charset($Zone->css_class) . '" rel="' . CS::Charset($Zone->Title) . '">' . CS::Charset($Zone->Content) . '</div>'; } } } } } else { } $Zone = ''; }
public static function action($a = '', $selfAction = '', $arguments = '') { $confirm = ''; $session = ''; $Request = new \CmsDev\Url\Request(); $All = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $_SERVER['REQUEST_URI']; //echo $All; //exit(); $find = array('/CloseAdmin', '/admin?invalid-admin', '/admin', '/UserLogin', '/UserLogin?invalid-user', '/UserLogout'); $LOCATION = str_replace($find, '', $All); if ($a === 'close' || $a === 'CloseAdmin') { if (!isset($_SESSION)) { session_start(); } unset($_SESSION['AccessLevel']); $_SESSION['language'] = THIS_LANG; unset($_SESSION['View_DesignCMS']); $_SESSION['login'] = ''; $_SESSION['sktlogin'] = ''; unset($_SESSION['UserID']); unset($_SESSION['UserName']); //$_SESSION['token'] = ''; $_SESSION['SKTVersion'] = \URL_VERSION; $header = $LOCATION; \CmsDev\Header\refresh::refreshNow(\SERVER_DIR); } else { $SKTDBadmin = SKT_DB::connect(); if ($a === 'Admin') { $MessageBox = SKT_INFO\Asistance::get(); //$MessageBox->TipInfo('Administrador: ' . $_POST["SKT_AdminName"] . ' - ' . $_POST["SKT_AdminPassword"]); $user_list = $SKTDBadmin->get_row("SELECT UserName,Password,md5,id, AccessLevel\r\n FROM admin \r\n WHERE UserName = "******"SKT_AdminName"], 'text') . " AND Password = "******"SKT_AdminPassword"], 'text') . ""); if ($user_list) { $session = md5($user_list->UserName . $user_list->Password); $confirm = 'ok'; $_SESSION['language'] = THIS_LANG; $_SESSION['View_DesignCMS'] = 0; $_SESSION['sktlogin'] = $session; $_SESSION['UserID'] = $user_list->id; $_SESSION['AccessLevel'] = $user_list->AccessLevel; $_SESSION['UserName'] = $user_list->UserName; $_SESSION['SKTVersion'] = \URL_VERSION; $header = $LOCATION; \CmsDev\Header\refresh::refreshNow(\SERVER_DIR); } else { $confirm = 'error'; $LoggedInAdmin = 0; $_SESSION['language'] = THIS_LANG; unset($_SESSION['View_DesignCMS']); $_SESSION['sktlogin'] = ''; unset($_SESSION['UserID']); unset($_SESSION['AccessLevel']); $_SESSION['UserName'] = \SKT_ADMIN_TXT_anonymous; $_SESSION['SKTVersion'] = \URL_VERSION; $MessageBox = SKT_INFO\Asistance::get(); $MessageBox->TipError(\SKT_ADMIN_User_Invalid . \SKT_ADMIN_User_max_attempts . \SKT_ADMIN_User_max_attempts_TXT); $header = \SKTURL . '?invalid-admin'; \CmsDev\Header\refresh::refreshNow($header); } } if ($a === 'login') { $user_list = $SKTDBadmin->get_row("SELECT *\r\n FROM users \r\n WHERE username = "******"SKT_UserName"], 'text') . " AND password = "******"SKT_Password"]), 'text') . ""); if ($user_list) { if ($user_list->isactive == 0) { \CmsDev\Header\refresh::refreshNow(\SKTURL . 'ValidateUser?username='******'login'] = $session; $_SESSION['UserIDU'] = $user_list->id; $SKTDBadmin->query(sprintf("UPDATE users SET md5 = %s WHERE ID = %s", \GetSQLValueString($session, "text"), \GetSQLValueString($user_list->id, 'int'))); $header = $LOCATION; \CmsDev\Header\refresh::refreshNow($header); } else { $header = \SKTURL . '?invalid-user'; \CmsDev\Header\refresh::refreshNow($header); } } if ($a === 'validateAdmin') { if (isset($_SESSION['sktlogin']) && $_SESSION['sktlogin'] != '') { $user_list = $SKTDBadmin->get_var("SELECT md5 FROM admin WHERE md5 = " . \GetSQLValueString($_SESSION['sktlogin'], 'text') . ""); if ($user_list === $_SESSION['sktlogin']) { return true; } else { return false; } } else { return false; } } if ($a === 'validateUser') { if (isset($_SESSION['login']) && $_SESSION['login'] != '') { $user_list = $SKTDBadmin->get_var("SELECT md5 FROM users WHERE md5 = " . \GetSQLValueString($_SESSION['login'], 'text') . ""); if ($user_list == $_SESSION['login']) { return true; } else { return false; } } else { return false; } } if ($a === 'validate') { if (self::action('validateAdmin') == true || self::action('validateUser') == true) { if ($selfAction !== '' && $arguments !== '') { return self::selfAction($selfAction, $arguments); } else { return true; } } else { return false; } } } }