private function run_seguridad() { $ajax = isset($_POST['ajax']) ? $_POST['ajax'] : 0; if ($this->allow_access === false) { if ($ajax == 1) { echo '<div class="fk-error-message">Acceso denegado</div>'; } else { fkore::_use('app/errors/acceso_denegado.php'); } die; } }
function fk_footer($theme = NULL) { if ($theme == NULL) { $theme = fk_theme(); } if (display_header_footer()) { if (display_blank_header()) { // Display Blank Header fk::blank_footer(); } else { // Header normal fkore::_use('public/_HTML/themes/' . $theme . '/footer.php'); } } }
/** * @desc Loads an internal url * @param $url; * @example when you need to load an internal url inside a view <b>Load::url('myaccount/general/');</b> will load myaccount.controller.php and executes general() method * * */ public static function url($url, $return = false) { $url_rs = fkore::url_processor($url); if (isset($url_rs['file_controller']) && isset($url_rs['controller']) && isset($url_rs['action'])) { if ($return == true) { ob_start(); } require_once SYSTEM_PATH . 'app/controllers/' . $url_rs['file_controller']; $page = new $url_rs['controller']($url_rs); if ($return == true) { $html = ob_get_contents(); ob_end_clean(); return $html; } } }
public function upload_file($ShowUpload = TRUE) { $id_file_cnt = 1; // Contador de archivos subidos if ($this->Directory != '') { // obtenemos los datos del archivo $file_ext = fkore::file_ext($_FILES["archivo"]["name"]); $id_usr = isset($_SESSION['id_usuario']) ? $_SESSION['id_usuario'] : '0'; $archivo = $id_usr . '_' . date('YmdHis') . '_' . substr(encode($_FILES["archivo"]['name']), 0, 6) . '.' . $file_ext; $this->file_name = $archivo; $this->file_size = $_FILES["archivo"]['size']; $this->file_type = $_FILES["archivo"]['type']; $this->file_ext = $file_ext; $this->file_title = $_FILES["archivo"]["name"]; //$tamano = $_FILES["archivo"]['size']; //$tipo = $_FILES["archivo"]['type']; $file_extencion_allowed = $this->verifyAllowedFileType(); if ($archivo != "" && $file_extencion_allowed == TRUE) { // (mmendoza )Removido //$this->forsa_creacion_dir($this-> Directory); $subfolder = $this->subfolder_creation(); // guardamos el archivo a la carpeta files $destino = $this->Directory . "/" . $subfolder . $archivo; if (copy($_FILES['archivo']['tmp_name'], $destino)) { // Guarda referencia en la db //$this->FileRecord-> fields[$this->fld_id] = 0; es new $this->FileRecord->fields[$this->fdl_id_user] = $_SESSION['id_usuario']; $this->FileRecord->fields[$this->fdl_id_cuenta] = $_SESSION['id_cuenta']; $this->FileRecord->fields[$this->fld_path] = $this->Directory; $this->FileRecord->fields[$this->fld_type] = $this->file_type; $this->FileRecord->fields[$this->fld_file_ext] = $this->file_ext; $this->FileRecord->fields[$this->fld_size] = $this->file_size; $this->FileRecord->fields[$this->fld_file] = $this->file_name; $this->FileRecord->fields[$this->fld_title] = $this->file_title; $this->FileRecord->fields[$this->fld_leyend] = $this->file_leyend; $this->FileRecord->fields[$this->fld_desc] = $this->file_desc; $this->FileRecord->fields[$this->fld_updated_date] = date('Y-m-d H:i:s'); $this->FileRecord->fields['upload_method'] = $this->uploadMethod; $this->FileRecord->insert(); $this->record_id = $this->FileRecord->inserted_id(); $this->FileRecord->fields[$this->fld_id] = $this->FileRecord->inserted_id(); if ($ShowUpload == TRUE) { echo fk_ok_message(__('El archivo subió correctamente')); } $this->UploadDetails[$id_file_cnt]['file'] = $this->FileRecord->fields; $this->UploadDetails[$id_file_cnt]['file']['http_path'] = $this->HttpDirectory . '/' . $archivo; } else { try { throw new FkException('Error al subir archivo'); } catch (FkException $e) { $e->show(); } } } else { echo fk_alert_message('Hubo un error al subir archivo'); $this->UploadDetails[$id_file_cnt]['error'][] = 'Extencion invalida o no hay archivo'; } } else { try { throw new FkException('$this->Directory no esta definido'); } catch (FkException $e) { $e->show(); } } }
private static function autoloader($Dir, $Arr) { if (count($Arr) > 0) { foreach ($Arr as $k => $v) { fkore::_use($Dir . '/' . $v . '.php'); } } }
return $SYS_PATH; } } /*fkore app start*/ if (!defined('SYSTEM_PATH')) { define('SYSTEM_PATH', start::get_filepath()); /*Carga todos los archivos requeridos*/ //Main Class FKORE require SYSTEM_PATH . 'freekore/fkore/fkore.class.php'; //load the app configuration fkore::load_configuration(); //Create url_relative HTTP constant fkore::createUrlRelative(); //load class require SYSTEM_PATH . 'freekore/fkore/load.class.php'; //agregar clase FkException require SYSTEM_PATH . 'freekore/fkore/fkexception.class.php'; //agregar clase AppController require SYSTEM_PATH . 'freekore/fkore/appcontroller.class.php'; // General libs require SYSTEM_PATH . 'freekore/fkore/fk.class.php'; require SYSTEM_PATH . 'freekore/fkore/fk.php'; //DEFINED VARS require SYSTEM_PATH . 'app/config/constants.php'; //load the app configuration //fkore::load_configuration(); //AutoLoad fkore::_use('app/config/autoload.php'); fkore::fk_autoload($GLOBALS['autoload']); isset($GLOBALS['autoload']); }
<?php /** * FreeKore Php Framework * Version: 0.1 Beta * * @Author M. Angel Mendoza email:mmendoza@freekore.com * @copyright Copyright (c) 2010 Freekore PHP Team * @license New BSD License */ include_once '../Freekore/start/start.php'; // Ejecutar FreeKore fkore::InitializeFK($_GET, $mod_rewrite = true);
public function renderAllComponent($getCurrentUrl) { $this->currentUrl = $getCurrentUrl; $GLOBALS['currentUrl'] = $this->currentUrl; $GLOBALS['tableFields'] = $this->tableFields; $GLOBALS['tableName'] = $this->tableName; $GLOBALS['fixedC'] = $this->fixedC; $GLOBALS['rules'] = $this->rules; $oper = fk_post('oper'); if ($oper == '') { // Default //fk_header_blank(); fk_header(); fkore::_use('app/plugins/FileImporter/import1.php'); fk_footer(); } elseif ($oper == 'step2') { //fk_header_blank(); //fk_header(); fkore::_use('app/plugins/FileImporter/import2.php'); //fk_footer(); } elseif ($oper == 'step3') { //fk_header_blank(); //fk_header(); fkore::_use('app/plugins/FileImporter/import3.php'); //fk_footer(); } }
*/ /*Carga todos los archivos requeridos*/ //Main Class FKORE include_once SYSTEM_PATH . 'Freekore/fkore/fkore.class.php'; //Create url_relative HTTP constant fkore::createUrlRelative(); //agregar librerias generales fkore::_use("Freekore/libs/*", ".php"); //agregar clase FkException fkore::_use('Freekore/fkore/FkException.class.php'); //agregar clase AppController fkore::_use('Freekore/fkore/AppController.class.php'); //agregar interface de base de datos fkore::_use('Freekore/fkore/db/db_interface.php'); //agregar adaptadores de base de datos fkore::_use("Freekore/fkore/db/adapters/*", ".php"); //agregar Active Record de base de datos fkore::_use("Freekore/fkore/db/db_record.class.php"); fkore::_use("Freekore/fkore/ActiveRecord.class.php"); //agregar Db Base fkore::_use("Freekore/fkore/db/db.php"); //DEFINED VARS fkore::_use('app/config/defined/default.php'); //load the app configuration fkore::load_configuration(); //LANGUAGE fkore::_use('app/locale/' . $GLOBALS['APP_LANGUAGE'] . '/index.php', $end = '', $requred = false); //AutoLoad fkore::_use('app/config/autoload.php'); fkore::fk_autoload();
fk_css(); fk_js(); ?> <!--menu--> <script type="text/javascript" src="<?php echo fk_theme_url(); ?> /menu.js"></script> </head> <body> <div id="header"> <div id="header-content"> <div id="logo"><a href="<?php echo fk_link(); ?> "> <img border="0" src="<?php echo fk_theme_url(); ?> /img/logo.png" title="Ekkus: Totem Software TM" alt="Ekkus: Totem Software TMk" /></a></div> </div> <?php // obtener menu fkore::_use('public/_HTML/themes/' . fk_theme() . '/menu-top.php'); ?> </div> <div id="content-main"> <div id="content">
<?php define('INCPATH', '../../../'); include_once INCPATH . 'freekore/start/start.php'; fkore::FkResource($_GET['r'], $_GET['t']);
<?php /** * FreeKore Php Framework * Version: 0.1 Beta * * @Author M. Angel Mendoza email:mmendoza@freekore.com * @copyright Copyright (c) 2010 Freekore PHP Team * @license New BSD License */ /** * Load public/index.php **/ if (@$GLOBALS['ENV']['mod_rewrite_engine'] == true) { //mod rewrite is not supported ?> <h2>Fkore: No tiene Mod-ReWrite de Apache instalado</h2> Debe habilitar/instalar mod_rewrite en su servidor Apache. Consulte para más información: <ul> <li><a href='http://httpd.apache.org/docs/2.0/misc/rewriteguide.html'>http://httpd.apache.org/docs/2.0/misc/rewriteguide.html</a> </ul> <?php } else { // Start app include_once './Freekore/start/start.php'; // Ejecutar FreeKore fkore::InitializeFK($_GET, $mod_rewrite = false); }
/** * @package Load * @method Plugin() * @desc Loads a Plugin | loads array of Plugins * @example 1) $this->Load->Plugin('MyPlugin'); calls app/PLUGINS/MyPlugin/MyPlugin.class.php * & app/PLUGINS/MyPlugin/MyPlugin.utils.php * 2) $this->Load->Plugin(array('MyPlugin1','MyPlugin2')); calls the array of Plugins * @since 0.1 Beta */ public function Plugin($Plugin) { if (is_array($Plugin)) { // Cargar Plugin if (count($Plugin) > 0) { foreach ($Plugin as $k => $v) { // Cargar el plugin fkore::_use($GLOBALS['FKORE']['config']['APP']['plugins_dir'] . '/' . $v . "/" . $v . ".class.php"); // get other variables (css code, css links, js code, js links ) fkore::_use($GLOBALS['FKORE']['config']['APP']['plugins_dir'] . "/" . $v . "/" . $v . ".utils.php"); } } // End count $Plugin >0 } else { // Cargar $Plugin fkore::_use($GLOBALS['FKORE']['config']['APP']['plugins_dir'] . "/" . $Plugin . "/" . $Plugin . ".class.php"); // get other variables (css code, css links, js code, js links ) fkore::_use($GLOBALS['FKORE']['config']['APP']['plugins_dir'] . "/" . $Plugin . "/" . $Plugin . ".utils.php"); } }
<?php /** * FreeKore Php Framework * Version: 0.2 * * @Author M. Angel Mendoza email:mmendoza@freekore.com * @copyright Copyright (c) 2010 Freekore PHP Team * @license GNU GENERAL PUBLIC LICENSE */ define('INCPATH', '../'); include INCPATH . 'freekore/start/start.php'; // Ejecutar FreeKore fkore::InitializeFK($_GET);
private static function autoloader($mode) { $Dir = $GLOBALS['FKORE']['config']['APP'][$mode . '_dir']; $Arr = $GLOBALS['autoload'][$mode]; if (count($Arr) > 0) { foreach ($Arr as $k => $v) { fkore::_use($Dir . '/' . $v . '.php'); } } }