コード例 #1
0
ファイル: error.php プロジェクト: jay-bricksoft/universePHP
 function __construct($type, $header, $message)
 {
     parent::__construct();
     if (!file_exists($this->config->logfolder)) {
         mkdir($this->config->logfolder, 0777, true);
     }
     $type = strtolower($type);
     parent::__construct();
     if ($type !== "notice" || $type === "notice" && $this->config->save_notice) {
         file_put_contents($this->config->logfolder . $this->config->logfile, "\"{$header}\" - \"{$message}\"" . PHP_EOL, FILE_APPEND) ? $type == "notice" && $this->config->show_notice || $this->config->show_error ? print "There was an error.\n\t\t\t\t\t\t\tIt was printed to the error-Log." : null : die("There was a serious error,which was caused by getting an include-error by then getting a log-error![HES DEAD!]");
     }
     switch ($type) {
         case "FATAL":
             print "The error was a FATAL Error, aborting.";
             break;
         case "notice":
             $this->config->show_notice ? print "The error was a(n) {$type}." : null;
             break;
         default:
             $this->config->show_error ? print "There was a(n) {$type} Error." : null;
     }
 }
コード例 #2
0
 function replace_admin_actions()
 {
     global $config, $lang;
     require_once $config['basepath'] . '/include/login.inc.php';
     $login = new login();
     $login_status = $login->loginCheck('Agent');
     if ($login_status !== true) {
         // Run theese commands even if not logged in.
         $data = '';
         switch ($_GET['action']) {
             case 'send_forgot':
                 require_once $config['basepath'] . '/include/login.inc.php';
                 $data = login::forgot_password();
                 break;
             case 'forgot':
                 require_once $config['basepath'] . '/include/login.inc.php';
                 $data = login::forgot_password_reset();
                 break;
             default:
                 $data .= $login_status;
                 break;
         }
     } else {
         switch ($_GET['action']) {
             case 'index':
                 require_once $config['basepath'] . '/include/admin.inc.php';
                 $admin = new general_admin();
                 $data = $admin->index_page();
                 break;
             case 'edit_page':
                 require_once $config['basepath'] . '/include/editor.inc.php';
                 $listing = new editor();
                 $data = $listing->page_edit();
                 break;
             case 'edit_user_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_user_images();
                 break;
             case 'edit_listing_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_listing_images();
                 break;
             case 'edit_vtour_images':
                 require_once $config['basepath'] . '/include/images.inc.php';
                 $images = new image_handler();
                 $data = $images->edit_vtour_images();
                 break;
             case 'edit_listing_files':
                 require_once $config['basepath'] . '/include/files.inc.php';
                 $files = new file_handler();
                 $data = $files->edit_listing_files();
                 break;
             case 'edit_user_files':
                 require_once $config['basepath'] . '/include/files.inc.php';
                 $files = new file_handler();
                 $data = $files->edit_user_files();
                 break;
             case 'add_listing':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->add_listing();
                 break;
             case 'edit_my_listings':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->edit_listings();
                 break;
             case 'edit_listings':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->edit_listings(false);
                 break;
             case 'configure':
                 require_once $config['basepath'] . '/include/controlpanel.inc.php';
                 $listing_editor = new configurator();
                 $data = $listing_editor->show_configurator();
                 break;
             case 'edit_listing_template':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template();
                 break;
             case 'edit_listings_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listings_template_field_order();
                 break;
             case 'edit_agent_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_template_field_order($type = 'agent');
                 break;
             case 'edit_member_template_field_order':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_template_field_order($type = 'member');
                 break;
             case 'edit_agent_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->add_user_template_field($type = 'agent');
                 break;
             case 'edit_member_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $type = 'member';
                 $data = $listing->add_user_template_field($type);
                 break;
             case 'edit_listing_template_search':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template_search();
                 break;
             case 'edit_listing_template_search_results':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_listing_template_search_results();
                 break;
             case 'user_manager':
                 require_once $config['basepath'] . '/include/user_manager.inc.php';
                 $user_managment = new user_managment();
                 $data = $user_managment->show_user_manager();
                 break;
             case 'edit_user_template':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->edit_user_template();
                 break;
             case 'edit_listing_template_add_field':
                 require_once $config['basepath'] . '/include/template_editor.inc.php';
                 $listing = new template_editor();
                 $data = $listing->add_listing_template_field();
                 break;
             case 'add_page':
                 require_once $config['basepath'] . '/include/editor.inc.php';
                 $listing = new editor();
                 $data = $listing->add_page();
                 break;
             case 'view_log':
                 require_once $config['basepath'] . '/include/log.inc.php';
                 $data = log::view();
                 break;
             case 'clear_log':
                 require_once $config['basepath'] . '/include/log.inc.php';
                 $data = log::clear_log();
                 break;
             case 'show_property_classes':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::show_classes();
                 break;
             case 'modify_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::modify_property_class();
                 break;
             case 'delete_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::delete_property_class();
                 break;
             case 'insert_property_class':
                 require_once $config['basepath'] . '/include/propertyclass.inc.php';
                 $data = propertyclass::insert_property_class();
                 break;
             case 'add_listing_property_class':
                 require_once $config['basepath'] . '/include/listing_editor.inc.php';
                 $listing_editor = new listing_editor();
                 $data = $listing_editor->add_listing_logic();
                 break;
                 //Todo Finish Adding Blog Items
             //Todo Finish Adding Blog Items
             case 'edit_blog':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->blog_edit_index();
                 break;
             case 'edit_blog_post':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->blog_edit();
                 break;
             case 'add_blog':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->add_post();
                 break;
             case 'edit_blog_post_comments':
                 require_once $config['basepath'] . '/include/blog_editor.inc.php';
                 $listing = new blog_editor();
                 $data = $listing->edit_post_comments();
                 break;
             case 'addon_manager':
                 require_once $config['basepath'] . '/include/addon_manager.inc.php';
                 $am = new addon_manager();
                 $data = $am->display_addon_manager();
                 break;
             case 'send_notifications':
                 require_once $config['basepath'] . '/include/notification.inc.php';
                 $notify = new notification();
                 $data = $notify->NotifyUsersOfAllNewListings();
                 break;
             default:
                 // Handle Addons
                 $addon_name = array();
                 if (preg_match("/^addon_(.\\S*?)_.*/", $_GET['action'], $addon_name)) {
                     include_once $config['basepath'] . '/addons/' . $addon_name[1] . '/addon.inc.php';
                     $function_name = $addon_name[1] . '_run_action_admin_template';
                     $data = $function_name();
                 }
         }
     }
     return $data;
 }
コード例 #3
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2009 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
$configurator->configure_table($_REQUEST['camila_custom'], false, $_REQUEST['camila_returl']);
require '../camila/footer.php';
コード例 #4
0
ファイル: import.inc.php プロジェクト: umbecr/camilaframework
function XLS_import2($file, $table, $db)
{
    $filename = basename($file);
    $sequence = intval(substr($filename, 0, strpos($filename, '_')));
    $res = $db->Execute('select id from ' . CAMILA_TABLE_WORKT . ' where filename=' . $db->qstr($filename));
    if ($res === false) {
        camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $db->ErrorMsg());
    }
    $id = $res->fields['id'];
    $result = array();
    $configurator = new configurator();
    $configurator->filename = $file;
    $configurator->sheetnum = 0;
    $configurator->interactive = false;
    $db->SetFetchMode(ADODB_FETCH_ASSOC);
    $configurator->db = $db;
    $configurator->configure_table($id, false);
    $record = array();
    $res = $db->Execute('select * from ' . CAMILA_TABLE_WORKT . ' where id=' . $db->qstr($id));
    if ($res === false) {
        camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $db->ErrorMsg());
    }
    $record['short_title'] = $res->fields['short_title'];
    $record['full_title'] = $res->fields['full_title'];
    $record['label_order'] = $sequence;
    $scriptname = $res->fields['scriptname'];
    $category = $res->fields['category'];
    $updateSQL = $db->AutoExecute(CAMILA_TABLE_PLANG, $record, 'UPDATE', 'page_url=' . $db->qstr($scriptname) . ' and lang=' . $db->qstr($_REQUEST['lang']));
    if (!$updateSQL) {
        camila_information_text(camila_get_translation('camila.worktable.db.error'));
    }
    if (trim($category) != '') {
        $res = $db->Execute('select page_url from ' . CAMILA_TABLE_PLANG . ' where short_title=' . $db->qstr($category) . ' AND page_url LIKE ' . $db->qstr('cf_app.php?cat%') . ' and lang=' . $db->qstr($_REQUEST['lang']));
        if ($res === false) {
            camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $db->ErrorMsg());
        }
        $cat_url = '-';
        if ($res->RecordCount() == 0) {
            $res = $db->Execute('select page_url from ' . CAMILA_TABLE_PLANG . ' where full_title<>' . $db->qstr('-') . ' AND page_url LIKE ' . $db->qstr('cf_app.php?cat%') . ' and lang=' . $db->qstr($_REQUEST['lang']));
            if ($res === false) {
                camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $db->ErrorMsg());
            }
            $cat_url = $res->fields['page_url'];
            $record = array();
            $record['label_order'] = $sequence;
            $record['short_title'] = $category;
            $record['full_title'] = '-';
            $updateSQL = $db->AutoExecute(CAMILA_TABLE_PLANG, $record, 'UPDATE', 'page_url=' . $db->qstr($cat_url) . ' and lang=' . $db->qstr($_REQUEST['lang']));
            if (!$updateSQL) {
                camila_information_text(camila_get_translation('camila.worktable.db.error'));
            }
        } else {
            $cat_url = $res->fields['page_url'];
        }
        $record = array();
        $record['parent'] = $cat_url;
        $updateSQL = $db->AutoExecute(CAMILA_TABLE_PAGES, $record, 'UPDATE', 'url=' . $db->qstr($scriptname));
        if (!$updateSQL) {
            camila_information_text(camila_get_translation('camila.worktable.db.error'));
        }
        $record = array();
        $record['visible'] = 'yes';
        $updateSQL = $db->AutoExecute(CAMILA_TABLE_PAGES, $record, 'UPDATE', 'url=' . $db->qstr($cat_url));
        if (!$updateSQL) {
            camila_information_text(camila_get_translation('camila.worktable.db.error'));
        }
    }
    $result['result'] = 2;
    //success
    $result['processed'] = 1;
    $result['failed'] = 0;
    return $result;
}
コード例 #5
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2010 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
$configurator->xls_import($_REQUEST['camila_custom'] . $_REQUEST['camilastep4_custom'], $_REQUEST['camila_returl']);
require '../camila/footer.php';
コード例 #6
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2009 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
if (isset($_REQUEST['camila_worktable_op'])) {
    $configurator->operation($_REQUEST['camila_custom'], $_REQUEST['camila_worktable_op'], $_REQUEST['camila_returl']);
} else {
    $configurator->admin();
}
require '../camila/footer.php';
コード例 #7
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2010 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
$configurator->admin_categories();
require '../camila/footer.php';
コード例 #8
0
<?php

/*This file is used for the development*/
if (file_exists('config.php')) {
    include_once 'interface/morgos.class.php';
    /* lets spoof $_POST
     * two problems with this approach:
     * enableUsers is reset to true (if config.php is writable)
     * adminUser is reset to test
     */
    $c = new configurator();
    $c->loadConfigFile('config.php');
    $_POST['action'] = 'installerInstall';
    $_POST['siteName'] = $c->getStringItem('/site/title');
    $_POST['siteDefaultLanguage'] = $c->getStringItem('/site/default_language');
    $_POST['databaseDriver'] = $c->getStringItem('/databases/driver');
    $_POST['databaseHost'] = $c->getStringItem('/databases/host');
    $_POST['databaseUser'] = $c->getStringItem('/databases/user');
    $_POST['databasePassword'] = $c->getStringItem('/databases/password');
    $_POST['databaseName'] = $c->getStringItem('/databases/database');
    $_POST['databasePrefix'] = $c->getStringItem('/databases/table_prefix');
    $_POST['adminLogin'] = '******';
    $_POST['adminPassword1'] = 'test';
    $_POST['adminPassword2'] = 'test';
    $_POST['adminMail'] = '*****@*****.**';
    // lets hack some more
    $_SERVER['REQUEST_METHOD'] = 'POST';
    DatabaseDriverManager::findAllDriversInDirectory('core/dbdrivers');
    $dbDriver = DatabaseDriverManager::loadDriver($_POST['databaseDriver']);
    $dbDriver->connect($_POST['databaseHost'], $_POST['databaseUser'], $_POST['databasePassword'], $_POST['databaseName']);
    foreach ($dbDriver->getAllTables() as $t) {
コード例 #9
0
ファイル: configs.php プロジェクト: nmoller/moodle_multisite
 public function __construct()
 {
     parent::__construct(array('dbname' => 'moodle_dev', 'wwwroot' => self::BASE . 'dev', 'dataroot' => '/var/www/html/moodledata'));
 }
コード例 #10
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2009 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
$configurator->start_wizard();
require '../camila/footer.php';
コード例 #11
0
<?php

/* This File is part of Camila PHP Framework
   Copyright (C) 2006-2009 Umberto Bresciani
   
   Camila PHP Framework is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   Camila PHP Framework is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with Camila PHP Framework; if not, write to the Free Software
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
require '../camila/header.php';
require CAMILA_DIR . 'datagrid/configurator.class.php';
$configurator = new configurator();
$configurator->configure_columns($_REQUEST['camila_custom'], $_REQUEST['camila_returl']);
require '../camila/footer.php';