当前位置: 首页>>代码示例>>PHP>>正文


PHP gen_redirect函数代码示例

本文整理汇总了PHP中gen_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP gen_redirect函数的具体用法?PHP gen_redirect怎么用?PHP gen_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了gen_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assets_tabs

 function assets_tabs()
 {
     global $db, $messageStack;
     $this->security_id = $_SESSION['admin_security'][SECURITY_ASSET_MGT_TABS];
     $this->db_table = TABLE_ASSETS_TABS;
     $this->title = BOX_ASSET_MODULE_TABS;
     $this->extra_buttons = false;
     $this->help_path = '';
     // make sure the module is installed
     $result = $db->Execute("SHOW TABLES LIKE '" . TABLE_ASSETS . "'");
     if ($result->RecordCount() == 0) {
         $messageStack->add_session(ASSET_MGR_NOT_INSTALLED, 'caution');
         gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=assets&module=admin', 'SSL'));
     }
 }
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:15,代码来源:assets_tabs.php

示例2: gen_add_audit_log

     gen_add_audit_log(PRICE_SHEETS_LOG . ($_REQUEST['action'] == 'save') ? TEXT_SAVE : TEXT_UPDATE, $sheet_name);
     gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('psID', 'action')), 'SSL'));
     break;
 case 'delete':
     validate_security($security_level, 4);
     $id = (int) db_prepare_input($_GET['psID']);
     $result = $db->Execute("select sheet_name, type, default_sheet from " . TABLE_PRICE_SHEETS . " where id = " . $id);
     $sheet_name = $result->fields['sheet_name'];
     $type = $result->fields['type'];
     if ($result->fields['default_sheet'] == '1') {
         $messageStack->add(PRICE_SHEET_DEFAULT_DELETED, 'caution');
     }
     $db->Execute("delete from " . TABLE_PRICE_SHEETS . " where id = '{$id}'");
     $db->Execute("delete from " . TABLE_INVENTORY_SPECIAL_PRICES . " where price_sheet_id = '{$id}'");
     gen_add_audit_log(PRICE_SHEETS_LOG . TEXT_DELETE, $sheet_name);
     gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('psID', 'action')) . '&type=' . $type, 'SSL'));
     break;
 case 'revise':
     validate_security($security_level, 2);
     $old_id = db_prepare_input($_GET['psID']);
     $result = $db->Execute("select * from " . TABLE_PRICE_SHEETS . " where id = {$old_id}");
     $old_rev = $result->fields['revision'];
     $output_array = array('sheet_name' => $result->fields['sheet_name'], 'type' => $type, 'revision' => $result->fields['revision'] + 1, 'effective_date' => gen_specific_date($result->fields['effective_date'], 1), 'default_sheet' => $result->fields['default_sheet'], 'default_levels' => $result->fields['default_levels']);
     db_perform(TABLE_PRICE_SHEETS, $output_array, 'insert');
     $id = db_insert_id();
     // this is used by the edit function later on.
     // expire the old sheet
     $db->Execute("UPDATE " . TABLE_PRICE_SHEETS . " SET expiration_date='" . gen_specific_date($result->fields['effective_date'], 1) . "' WHERE id={$old_id}");
     // Copy special pricing information to new sheet
     $levels = $db->Execute("select inventory_id, price_levels from " . TABLE_INVENTORY_SPECIAL_PRICES . " where price_sheet_id = {$old_id}");
     while (!$levels->EOF) {
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php

示例3: unserialize

$result = $db->Execute("select admin_prefs from " . TABLE_USERS . " where admin_id = " . $_SESSION['admin_id']);
$prefs = unserialize($result->fields['admin_prefs']);
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/profile/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        validate_security($security_level, 4);
        $prefs['theme'] = db_prepare_input($_POST['theme']);
        $prefs['menu'] = db_prepare_input($_POST['menu']);
        $prefs['colors'] = db_prepare_input($_POST['colors']);
        if (!$prefs['colors']) {
            $error = $messageStack->add(GEN_ERROR_NO_THEME_COLORS, 'error');
            break;
        }
        db_perform(TABLE_USERS, array('admin_prefs' => serialize($prefs)), 'update', 'admin_id = ' . $_SESSION['admin_id']);
        $_SESSION['admin_prefs']['theme'] = $prefs['theme'];
        $_SESSION['admin_prefs']['menu'] = $prefs['menu'];
        $_SESSION['admin_prefs']['colors'] = $prefs['colors'];
        gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(), 'SSL'));
        break;
    default:
}
/*****************   prepare to display templates  *************************/
$include_header = true;
$include_footer = true;
$include_template = 'template_main.php';
define('PAGE_TITLE', BOX_HEADING_PROFILE);
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php

示例4: validate_gl_balances

function validate_gl_balances($action)
{
    global $db, $currencies, $messageStack;
    $fiscal_years = array();
    $sql = "select distinct fiscal_year, min(period) as first_period, max(period) as last_period\r\n\t  from " . TABLE_ACCOUNTING_PERIODS . " group by fiscal_year order by fiscal_year ASC";
    $result = $db->Execute($sql);
    while (!$result->EOF) {
        $fiscal_years[] = array('fiscal_year' => $result->fields['fiscal_year'], 'first_period' => $result->fields['first_period'], 'last_period' => $result->fields['last_period']);
        $result->MoveNext();
    }
    $beg_bal = array();
    $bad_accounts = array();
    foreach ($fiscal_years as $fiscal_year) {
        $sql = "select account_id, period, beginning_balance, (beginning_balance + debit_amount - credit_amount) as next_beg_bal\r\n\t\tfrom " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \r\n\t\twhere period >= " . $fiscal_year['first_period'] . " and period <= " . $fiscal_year['last_period'] . " \r\n\t\torder by period, account_id";
        $result = $db->Execute($sql);
        while (!$result->EOF) {
            $period = $result->fields['period'];
            $next_period = $period + 1;
            $gl_account = $result->fields['account_id'];
            $beg_balance = $currencies->format($result->fields['beginning_balance']);
            $next_beg_bal = $currencies->format($result->fields['next_beg_bal']);
            $beg_bal[$next_period][$gl_account] = $next_beg_bal;
            if ($period != 1 && $beg_bal[$period][$gl_account] != $beg_balance) {
                if ($action != 'coa_hist_fix') {
                    $messageStack->add(sprintf(GEN_ADM_TOOLS_REPAIR_ERROR_MSG, $period, $gl_account, $beg_bal[$period][$gl_account], $beg_balance), 'caution');
                }
                $bad_accounts[$period][$gl_account] = array('sync' => '1');
            }
            // check posted transactions to account to see if they match
            $posted = $db->Execute("select sum(debit_amount) as debit, sum(credit_amount) as credit \r\n\t\t  from " . TABLE_JOURNAL_MAIN . " m join " . TABLE_JOURNAL_ITEM . " i on m.id = i.ref_id\r\n\t\t  where period = " . $period . " and gl_account = '" . $gl_account . "' \r\n\t\t  and journal_id in (2, 6, 7, 12, 13, 14, 16, 18, 19, 20, 21)");
            $posted_bal = $currencies->format($result->fields['beginning_balance'] + $posted->fields['debit'] - $posted->fields['credit']);
            if ($posted_bal != $next_beg_bal) {
                if ($action != 'coa_hist_fix') {
                    $messageStack->add(sprintf(GEN_ADM_TOOLS_REPAIR_ERROR_MSG, $period, $gl_account, $posted_bal, $next_beg_bal), 'caution');
                }
                $bad_accounts[$period][$gl_account] = array('sync' => '1', 'debit' => $posted->fields['debit'], 'credit' => $posted->fields['credit']);
            }
            $result->MoveNext();
        }
        // roll the fiscal year balances
        $result = $db->Execute("select id from " . TABLE_CHART_OF_ACCOUNTS . " where account_type = 44");
        $retained_earnings_acct = $result->fields['id'];
        // select list of accounts that need to be closed, adjusted
        $sql = "select id from " . TABLE_CHART_OF_ACCOUNTS . " where account_type in (30, 32, 34, 42, 44)";
        $result = $db->Execute($sql);
        $acct_list = array();
        while (!$result->EOF) {
            $beg_bal[$next_period][$result->fields['id']] = 0;
            $acct_list[] = $result->fields['id'];
            $result->MoveNext();
        }
        // fetch the totals for the closed accounts
        $sql = "select sum(beginning_balance + debit_amount - credit_amount) as retained_earnings \r\n\t\tfrom " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \r\n\t\twhere account_id in ('" . implode("','", $acct_list) . "') and period = " . $period;
        $result = $db->Execute($sql);
        $beg_bal[$next_period][$retained_earnings_acct] = $currencies->format($result->fields['retained_earnings']);
    }
    if ($action == 'coa_hist_fix') {
        // find the affected accounts
        if (sizeof($bad_accounts) > 0) {
            // *************** START TRANSACTION *************************
            $db->transStart();
            $glEntry = new journal();
            $min_period = 999999;
            foreach ($bad_accounts as $period => $acct_array) {
                foreach ($acct_array as $gl_acct => $value) {
                    $min_period = min($period, $min_period);
                    // find first period that has an error
                    $glEntry->affected_accounts[$gl_acct] = 1;
                    if (isset($value['debit'])) {
                        // the history doesn't match posted data, repair
                        $db->Execute("update " . TABLE_CHART_OF_ACCOUNTS_HISTORY . " \r\n\t\t\t    set debit_amount = " . $value['debit'] . ", credit_amount = " . $value['credit'] . " \r\n\t\t\t    where period = " . $period . " and account_id = '" . $gl_acct . "'");
                    }
                }
            }
            $debug = true;
            if ($glEntry->update_chart_history_periods($min_period - 1)) {
                // from prior period than the error account
                $db->transCommit();
                $messageStack->add_session(GEN_ADM_TOOLS_REPAIR_COMPLETE, 'success');
                gen_add_audit_log(GEN_ADM_TOOLS_REPAIR_LOG_ENTRY);
                gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')) . 'action=coa_hist_test', 'SSL'));
            }
        }
    }
    if (sizeof($bad_accounts) == 0) {
        $messageStack->add(GEN_ADM_TOOLS_REPAIR_SUCCESS, 'success');
    } else {
        $messageStack->add(GEN_ADM_TOOLS_REPAIR_ERROR, 'error');
    }
}
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:90,代码来源:general.php

示例5: switch

switch ($_REQUEST['action']) {
    case 'save':
        foreach ($dashboards as $dashboard) {
            // build add and delete list
            // if post is set and not in my_profile -> add
            if (isset($_POST[$dashboard['dashboard_id']]) && !in_array($dashboard['dashboard_id'], $my_profile)) {
                include_once DIR_FS_MODULES . $dashboard['module_id'] . '/dashboards/' . $dashboard['dashboard_id'] . '/' . $dashboard['dashboard_id'] . '.php';
                $dbItem = new $dashboard['dashboard_id']();
                $dbItem->menu_id = $menu_id;
                $dbItem->module_id = $dashboard['module_id'];
                $dbItem->Install();
            }
            // if post is not set and in my_profile -> delete
            if (!isset($_POST[$dashboard['dashboard_id']]) && in_array($dashboard['dashboard_id'], $my_profile)) {
                // delete it
                include_once DIR_FS_MODULES . $dashboard['module_id'] . '/dashboards/' . $dashboard['dashboard_id'] . '/' . $dashboard['dashboard_id'] . '.php';
                $dbItem = new $dashboard['dashboard_id']();
                $dbItem->menu_id = $menu_id;
                $dbItem->module_id = $dashboard['module_id'];
                $dbItem->Remove();
            }
        }
        gen_redirect(html_href_link(FILENAME_DEFAULT, '&module=phreedom&page=main&mID=' . $menu_id, 'SSL'));
        break;
    default:
}
/*****************   prepare to display templates  *************************/
$include_header = true;
$include_footer = true;
$include_template = 'template_main.php';
define('PAGE_TITLE', CP_ADD_REMOVE_BOXES);
开发者ID:TrinityComputers,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php

示例6: load_full_access_security

                    $fields = $result->fields;
                    $fields['admin_security'] = load_full_access_security();
                    $result = db_perform(TABLE_USERS, $fields, 'insert');
                }
            }
        }
        if (!$error) {
            // reset SESSION['company'] to new company and redirect to install->store_setup
            $messageStack->add(SETUP_CO_MGR_CREATE_SUCCESS, 'success');
            gen_add_audit_log(SETUP_CO_MGR_LOG . ($action == 'new' ? TEXT_NEW : TEXT_COPY), $company);
            $_SESSION['company'] = $company;
            // save the necessary db variables to continue setup
            $_SESSION['db_server'] = $db_server;
            $_SESSION['db_user'] = $db_user;
            $_SESSION['db_pw'] = $db_pw;
            gen_redirect(html_href_link(DIR_WS_MODULES . 'install/index.php?main_page=' . ($action == 'new' ? 'admin_setup' : 'store_setup') . '&language=' . $_SESSION['language'], '', 'SSL'));
        }
        break;
    case 'delete':
        $company = $_SESSION['companies'][$_POST['company']];
        // Failsafe to prevent current company from being deleted accidently
        if ($company != $_SESSION['company']) {
            $db->Execute("drop database " . $company);
            delete_dir(DIR_FS_MY_FILES . $company);
        }
        gen_add_audit_log(SETUP_CO_MGR_LOG . TEXT_DELETE, $company);
        $messageStack->add(SETUP_CO_MGR_DELETE_SUCCESS, 'success');
        break;
    default:
}
/*****************   prepare to display templates  *************************/
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例7: array

            $order->item_rows[0] = array('pstd' => '1', 'id' => '', 'desc' => db_prepare_input($_POST['desc_1']), 'total' => $currencies->clean_value(db_prepare_input($_POST['total_1'])), 'acct' => db_prepare_input($_POST['acct_1']));
            $post_credit = $order->post_ordr($action);
            if (!$post_credit) {
                $order = new objectInfo($_POST);
                $order->post_date = gen_db_date_short($_POST['post_date']);
                // fix the date to original format
                $order->id = $_POST['id'] != '' ? $_POST['id'] : '';
                // will be null unless opening an existing purchase/receive
                $messageStack->add(GL_ERROR_NO_POST, 'error');
            }
            gen_add_audit_log(AUDIT_LOG_DESC, $order->purchase_invoice_id, $order->total_amount);
            if (DEBUG) {
                $messageStack->write_debug();
            }
            if ($action == 'save') {
                gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
            }
            // else print or print_update, fall through and load javascript to call form_popup and clear form
        } else {
            // else there was a post error, display and re-display form
            $order = new objectInfo($_POST);
            $order->post_date = gen_db_date_short($_POST['post_date']);
            // fix the date to original format
            $order->id = $_POST['id'] != '' ? $_POST['id'] : '';
            // will be null unless opening an existing purchase/receive
            $messageStack->add(GL_ERROR_NO_POST, 'error');
        }
        break;
    default:
}
/*****************   prepare to display templates  *************************/
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例8: gen_redirect

// | This program 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.                    |
// |                                                                 |
// | The license that is bundled with this package is located in the |
// | file: /doc/manual/ch01-Introduction/license.html.               |
// | If not, see http://www.gnu.org/licenses/                        |
// +-----------------------------------------------------------------+
//  Path: /modules/general/pages/pw_lost/pre_process.php
//
/**************  include page specific files    *********************/
require DIR_FS_WORKING . 'functions/general.php';
/**************   page specific initialization  *************************/
if (isset($_POST['login'])) {
    gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=general&amp;module=login', 'SSL'));
}
$error_check = false;
if (isset($_POST['submit'])) {
    if (!$_POST['admin_email']) {
        $error_check = true;
        $email_message = ERROR_WRONG_EMAIL_NULL;
    }
    $_SESSION['company'] = $_SESSION['companies'][$_POST['company']];
    $admin_email = db_prepare_input($_POST['admin_email']);
    $sql = "select admin_id, admin_name, admin_email, admin_pass \r\n  \tfrom " . TABLE_USERS . " where admin_email = '" . db_input($admin_email) . "'";
    $result = $db->Execute($sql);
    if (!($admin_email == $result->fields['admin_email'])) {
        $error_check = true;
        $email_message = ERROR_WRONG_EMAIL;
    }
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例9: gen_redirect

}
/**************  include page specific files    *********************/
@(include_once DIR_FS_WORKING . 'config.php');
// pull the current config info, if it is there
@(include_once DIR_FS_WORKING . 'language/' . $_SESSION['language'] . '/language.php');
require_once DIR_FS_MODULES . 'services/shipping/language/' . $_SESSION['language'] . '/language.php';
require_once DIR_FS_WORKING . 'functions/zencart.php';
require_once DIR_FS_MODULES . 'inventory/functions/inventory.php';
require_once DIR_FS_WORKING . 'classes/parser.php';
require_once DIR_FS_WORKING . 'classes/zencart.php';
require_once DIR_FS_WORKING . 'classes/bulk_upload.php';
/**************   page specific initialization  *************************/
// make sure the module is installed
if (!defined('ZENCART_URL')) {
    $messageStack->add_session(ZENCART_MOD_NOT_INSTALLED, 'caution');
    gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=zencart&module=admin', 'SSL'));
}
$error = false;
$ship_date = $_POST['ship_date'] ? gen_db_date_short($_POST['ship_date']) : date('Y-m-d');
$action = isset($_GET['action']) ? $_GET['action'] : $_POST['todo'];
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MY_FILES . 'custom/zencart/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($action) {
    case 'upload':
        $upXML = new zencart();
        $id = db_prepare_input($_POST['rowSeq']);
        if ($upXML->submitXML($id, 'product_ul')) {
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例10: Execute

 function Execute($zf_sql, $zf_limit = false, $zf_cache = false, $zf_cachetime = 0)
 {
     global $zc_cache, $messageStack;
     if ($zf_limit) {
         $zf_sql = $zf_sql . ' LIMIT ' . $zf_limit;
     }
     if ($zf_cache and $zc_cache->sql_cache_exists($zf_sql) and !$zc_cache->sql_cache_is_expired($zf_sql, $zf_cachetime)) {
         $obj = new queryFactoryResult();
         $obj->cursor = 0;
         $obj->is_cached = true;
         $obj->sql_query = $zf_sql;
         $zp_result_array = $zc_cache->sql_cache_read($zf_sql);
         $obj->result = $zp_result_array;
         if (sizeof($zp_result_array) > 0) {
             $obj->EOF = false;
             while (list($key, $value) = each($zp_result_array[0])) {
                 $obj->fields[$key] = $value;
             }
             return $obj;
         } else {
             $obj->EOF = true;
         }
     } elseif ($zf_cache) {
         $zc_cache->sql_cache_expire_now($zf_sql);
         $time_start = explode(' ', microtime());
         $obj = new queryFactoryResult();
         $obj->sql_query = $zf_sql;
         if (!$this->db_connected) {
             $this->set_error('0', DB_ERROR_NOT_CONNECTED);
         }
         $zp_db_resource = @mysql_query($zf_sql, $this->link);
         if (!$zp_db_resource) {
             $this->set_error(@mysql_errno(), @mysql_error());
         }
         $obj->resource = $zp_db_resource;
         $obj->cursor = 0;
         $obj->is_cached = true;
         if ($obj->RecordCount() > 0) {
             $obj->EOF = false;
             $zp_ii = 0;
             while (!$obj->EOF) {
                 $zp_result_array = @mysql_fetch_array($zp_db_resource);
                 if ($zp_result_array) {
                     while (list($key, $value) = each($zp_result_array)) {
                         if (!preg_match('/^[0-9]/', $key)) {
                             $obj->result[$zp_ii][$key] = $value;
                         }
                     }
                 } else {
                     $obj->Limit = $zp_ii;
                     $obj->EOF = true;
                 }
                 $zp_ii++;
             }
             while (list($key, $value) = each($obj->result[$obj->cursor])) {
                 if (!preg_match('/^[0-9]/', $key)) {
                     $obj->fields[$key] = $value;
                 }
             }
             $obj->EOF = false;
         } else {
             $obj->EOF = true;
         }
         $zc_cache->sql_cache_store($zf_sql, $obj->result);
         $time_end = explode(' ', microtime());
         $query_time = $time_end[1] + $time_end[0] - $time_start[1] - $time_start[0];
         $this->total_query_time += $query_time;
         $this->count_queries++;
         return $obj;
     } else {
         $time_start = explode(' ', microtime());
         $obj = new queryFactoryResult();
         if (!$this->db_connected) {
             $this->set_error('0', DB_ERROR_NOT_CONNECTED);
         }
         $zp_db_resource = @mysql_query($zf_sql, $this->link);
         if (!$zp_db_resource) {
             if ($_POST['page'] == 'ajax' || $_GET['page'] == 'ajax') {
                 $messageStack->debug("\n\nThe failing sql was: " . $zf_sql);
                 $messageStack->debug("\n\nmySQL returned: " . @mysql_errno($this->link) . ' ' . @mysql_error($this->link));
                 if (defined('FILENAME_DEFAULT')) {
                     $messageStack->write_debug();
                 }
                 echo createXmlHeader() . xmlEntry('error', 'There was a SQL Error: ' . @mysql_error($this->link)) . createXmlFooter();
                 die;
             }
             if (method_exists($messageStack, 'debug')) {
                 $messageStack->debug("\n\nThe failing sql was: " . $zf_sql);
                 $messageStack->debug("\n\nmySQL returned: " . @mysql_errno($this->link) . ' ' . @mysql_error($this->link));
                 if (defined('FILENAME_DEFAULT')) {
                     $messageStack->write_debug();
                     $messageStack->add('The last transaction had a SQL database error.', 'error');
                     gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=phreedom&page=main&amp;action=crash', 'SSL'));
                 } else {
                     echo str_replace("\n", '<br />', $messageStack->debug_info);
                     die;
                 }
             } else {
                 echo str_replace("\n", '<br />', $messageStack->debug_info);
                 die;
//.........这里部分代码省略.........
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:101,代码来源:query_factory.php

示例11: validate_security

function validate_security($security_level = 0, $required_level = 1)
{
    global $messageStack;
    if ($security_level < $required_level) {
        $messageStack->add(ERROR_NO_PERMISSION, 'error');
        gen_redirect(html_href_link(FILENAME_DEFAULT, gen_get_all_get_params(array('action')), 'SSL'));
    }
    return true;
}
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:9,代码来源:common_functions.php

示例12: gen_auto_update_period

        if (AUTO_UPDATE_PERIOD) {
            gen_auto_update_period();
        }
        gen_add_audit_log(GEN_LOG_LOGIN . $admin_name);
        // check for session timeout to reload to requested page
        $get_params = '';
        if (isset($_SESSION['pb_cat'])) {
            $get_params = 'cat=' . $_SESSION['pb_cat'];
            $get_params .= '&amp;module=' . $_SESSION['pb_module'];
            if (isset($_SESSION['pb_jID'])) {
                $get_params .= '&amp;jID=' . $_SESSION['pb_jID'];
            }
            if (isset($_SESSION['pb_type'])) {
                $get_params .= '&amp;type=' . $_SESSION['pb_type'];
            }
        }
        gen_redirect(html_href_link(FILENAME_DEFAULT, $get_params, 'SSL'));
    } else {
        // Note: This is assigned to admin id = 1 since the user is not logged in.
        gen_add_audit_log(GEN_LOG_LOGIN_FAILED . $admin_name);
    }
}
// prepare to display form
if (isset($_COOKIE['pb_company'])) {
    $admin_company = $_COOKIE['pb_company'];
    $admin_language = $_COOKIE['pb_language'];
    $admin_theme = $_COOKIE['pb_theme'];
} else {
    $admin_theme = 'default';
}
define('PAGE_TITLE', TITLE);
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例13: gen_get_dates

         require_once DIR_FS_MODULES . 'phreebooks/functions/phreebooks.php';
         $dates = gen_get_dates();
         validate_fiscal_year($dates['ThisYear'], '1', $dates['ThisYear'] . '-' . $dates['ThisMonth'] . '-01');
         build_and_check_account_history_records();
         gen_auto_update_period(false);
     }
     if (!$error) {
         // reset SESSION['company'] to new company and redirect to install->store_setup
         $db->Execute("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $co_name . "' \n\t    where configuration_key = 'COMPANY_NAME'");
         $messageStack->add(SETUP_CO_MGR_CREATE_SUCCESS, 'success');
         gen_add_audit_log(SETUP_CO_MGR_LOG . TEXT_COPY, $db_name);
         $_SESSION['db_server'] = $db_server;
         $_SESSION['company'] = $db_name;
         $_SESSION['db_user'] = $db_user;
         $_SESSION['db_pw'] = $db_pw;
         gen_redirect(html_href_link(FILENAME_DEFAULT, $get_parmas, ENABLE_SSL_ADMIN ? 'SSL' : 'NONSSL'));
     } else {
         // restore db connection
         $db = new queryFactory();
         $db->connect(DB_SERVER_HOST, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);
     }
     $default_tab_id = 'manager';
     break;
 case 'delete_co':
     $db_name = $_SESSION['companies'][$_POST['del_company']];
     // Failsafe to prevent current company from being deleted accidently
     $backup = new backup();
     if ($db_name == 'none') {
         $error = $messageStack->add(SETUP_CO_MGR_NO_SELECTION, 'error');
     }
     if (!$error && $db_name != $_SESSION['company']) {
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php

示例14: gen_redirect

}
/**************  include page specific files    *********************/
@(include_once DIR_FS_WORKING . 'config.php');
// pull the current config info, if it is there
@(include_once DIR_FS_WORKING . 'language/' . $_SESSION['language'] . '/language.php');
require_once DIR_FS_MODULES . 'services/shipping/language/' . $_SESSION['language'] . '/language.php';
require_once DIR_FS_WORKING . 'functions/oscommerce.php';
require_once DIR_FS_MODULES . 'inventory/functions/inventory.php';
require_once DIR_FS_WORKING . 'classes/parser.php';
require_once DIR_FS_WORKING . 'classes/oscommerce.php';
require_once DIR_FS_WORKING . 'classes/bulk_upload.php';
/**************   page specific initialization  *************************/
// make sure the module is installed
if (!defined('OSCOMMERCE_URL')) {
    $messageStack->add_session(OSCOMMERCE_MOD_NOT_INSTALLED, 'caution');
    gen_redirect(html_href_link(FILENAME_DEFAULT, 'cat=oscommerce&module=admin', 'SSL'));
}
$error = false;
$ship_date = $_POST['ship_date'] ? gen_db_date_short($_POST['ship_date']) : date('Y-m-d');
$action = isset($_GET['action']) ? $_GET['action'] : $_POST['todo'];
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MY_FILES . 'custom/oscommerce/main/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($action) {
    case 'upload':
        $upXML = new oscommerce();
        $id = db_prepare_input($_POST['rowSeq']);
        if ($upXML->submitXML($id, 'product_ul')) {
开发者ID:jigsmaheta,项目名称:puerto-argentino,代码行数:31,代码来源:pre_process.php

示例15: define

            }
        } else {
            $include_template = 'template_install.php';
            define('PAGE_TITLE', TITLE_INSTALL);
        }
        break;
    case 'finish':
        $include_template = 'template_finish.php';
        define('PAGE_TITLE', INSTALL_TITLE_FINISH);
        break;
    case 'open_company':
        require '../includes/configure.php';
        $path = (ENABLE_SSL_ADMIN == 'true' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_ADMIN;
        define('DIR_WS_FULL_PATH', $path);
        // full http path (or https if secure)
        gen_redirect(html_href_link('index.php', '', 'SSL'));
        break;
}
/*****************   prepare to display templates  *************************/
$sel_yes_no = array(array('id' => '0', 'text' => TEXT_NO), array('id' => '1', 'text' => TEXT_YES));
$sel_fy_month = array(array('id' => '01', 'text' => TEXT_JAN), array('id' => '02', 'text' => TEXT_FEB), array('id' => '03', 'text' => TEXT_MAR), array('id' => '04', 'text' => TEXT_APR), array('id' => '05', 'text' => TEXT_MAY), array('id' => '06', 'text' => TEXT_JUN), array('id' => '07', 'text' => TEXT_JUL), array('id' => '08', 'text' => TEXT_AUG), array('id' => '09', 'text' => TEXT_SEP), array('id' => '10', 'text' => TEXT_OCT), array('id' => '11', 'text' => TEXT_NOV), array('id' => '12', 'text' => TEXT_DEC));
$sel_fy_year = array();
for ($i = 0; $i < 6; $i++) {
    $sel_fy_year[] = array('id' => date('Y') + $i - 5, 'text' => date('Y') + $i - 5);
}
// Determine http path
$srvr_http = 'http://' . $_SERVER['HTTP_HOST'];
$srvr_https = 'https://' . $_SERVER['HTTP_HOST'];
// find the license
if (file_exists('../modules/phreedom/language/' . $lang . '/manual/ch01-Introduction/license.html')) {
    $license_path = '../modules/phreedom/language/' . $lang . '/manual/ch01-Introduction/license.html';
开发者ID:siwiwit,项目名称:PhreeBooksERP,代码行数:31,代码来源:pre_process.php


注:本文中的gen_redirect函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。