[go: up one dir, main page]

Menu

[c6da1b]: / cli.php  Maximize  Restore  History

Download this file

226 lines (198 with data), 13.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?php
defined("cmr_online") or die("hacking attempt, application is not online, click <a href=\"index.php?cmr_mode=login\" > Here </a> to login before continue ");
/*=================================================================*/
// vim
// set expandtab
// set shiftwidth=4
// set softtabstop=4
// set tabstop=4
// 80 char / line
// * @package cmr
// * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
// * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL,
// * This version may have been modified pursuant
// * to the GNU General Public License, and as distributed it includes or
// * is derivative of works licensed under the GNU General Public License or
// * other free or open source software licenses.
// */
// this is php index file, the, most important file, were to see how TSTM work configuration file ./conf.php
// the general static configuration file ./conf.php
// generaly all line will be transform from [cmr_with_login==1] to [define('cmr_with_login')='1';] before php execution
// to configure the interface (module windows position) for all user, see ./page.ini or ./themes.ini or ./cmr.css
// to configure the interface (module windows position) for a group, see ./home/{group}/page.ini or ./home/{group}/themes.ini or ./home/{group}/cmr.css
// the language file is ./language.ini or ./language/lang_to_use/language.ini
// the default windows themes configuration file ./themes.ini or ./themes/{themes_folder}/themes.ini
// the database connection configuation is in ./connect.php or in ./home/{group}/connect.php (the default one is in ./conf.php )
/*
=================================================================
**/
include_once(dirname(__FILE__) . "/camaroes_class.php");
$cmr = new camaroes();
// $cmr->show();
// print_r($cmr);
// exit;
/*==================*/
/*==================*/
include_once(dirname(__FILE__) . "/control.php"); //to control access in the module
if(file_exists(dirname(__FILE__) . "/config.inc.php")){
include_once(dirname(__FILE__) . "/config.inc.php");
}else{
$cmr->config["cmr_main_config"]=dirname(__FILE__) . "/conf.d/conf.ini"; // conf_file_exist($cmr->get_conf("cmr_main_config"));
}
/*==================*/
/*==================*/
include_once(dirname(__FILE__) . "/system/function.php");
/*==================*/
/*==================*/
$cmr->config = $cmr->include_conf($cmr->get_conf("cmr_main_config"), $cmr->config, "var");
$cmr->config = $cmr->preload_config();
/*==================*/
/*==================*/
if(empty($cmr->get_path("index"))) $cmr->get_path("index") = realpath("./");
$cmr->get_path("index") = realpath($cmr->get_path("index")) . "/";
/*==================*/
/*==================*/
$cmr->config["cmr_with_login"] = 1;
$cmr->config["cmr_no_auth"] = 0;
$cmr->config["cmr_apache_auth"] = 1;
$cmr->config["cmr_radius_auth"] = 0;
$cmr->config["cmr_other_auth"] = 0;
$cmr->config["cmr_url_auth"] = 1;
$cmr->config["cmr_output_buffering"] = 0;
// $cmr->get_path("index") = $_SERVER["PWD"]."/";
// $cmr->get_path("home") = $_SERVER["PWD"]."/";
// $cmr->get_path("log") = $_SERVER["PWD"]."/";
// $cmr->get_path("module") = $_SERVER["PWD"]."/";
// $cmr->get_path("db") = $_SERVER["PWD"]."/";
// $cmr->get_path("help") = $_SERVER["PWD"]."/";
// $cmr->get_path("func") = $_SERVER["PWD"]."/";
// $cmr->get_path("conf") = $_SERVER["PWD"]."/";
// $cmr->get_path("image") = $_SERVER["PWD"]."/";
// $cmr->get_path("lang") = $_SERVER["PWD"]."/";
// $cmr->get_path("theme") = $_SERVER["PWD"]."/";
// $cmr->get_path("lib") = $_SERVER["PWD"]."/";
// $cmr->get_path("temp") = "/temp/";// es: /temp/
// $cmr->get_path("template") = $_SERVER["PWD"]."/";
// $cmr->get_path("model") = $_SERVER["PWD"]."/";
// $cmr->get_path("session") = getenv("TEMP")."/";// es: /temp/
/*==================*/
/*==================*/
$cmr->action["to_load"]="preload_function";
include($cmr->get_path("index") . "system/loader/loader_function.php");
$cmr->action["to_load"]="preload_class";
include($cmr->get_path("index") . "system/loader/loader_class.php");
/*==================*/
/*==================*/
$cmr->load_session_mode();
/* set the cache limiter to 'nocache' */
session_cache_limiter('nocache');
/* set the cache expire to 30 minutes */
session_cache_expire(36000);
/* start the session */
session_start();
// $cmr->debug_print();exit;
/*==================*/
/*==================*/
// $cmr->language = auto_language($cmr->config, $cmr->language, $cmr->db_connection); //__automatic create language traduction
$cmr->language = $cmr->include_conf($cmr->get_conf("cmr_begin_lang_file"), $cmr->language, "var");
$cmr->page = $cmr->include_conf($cmr->get_conf("cmr_begin_pager_file"), $cmr->page, "var");// =========== default config ==================
$cmr->themes = $cmr->include_conf($cmr->get_conf("cmr_begin_theme_file"), $cmr->themes, "var");
$cmr->language = $cmr->include_conf($cmr->get_path("lang") . "languages/". $cmr->get_conf("cmr_default_lang"). "/" . $cmr->get_conf("cmr_lang_config"), $cmr->language, "var");
$cmr->themes = $cmr->include_conf($cmr->get_path("theme") . "themes/". $cmr->get_conf("cmr_default_theme") . "/" . $cmr->get_conf("cmr_themes_config"), $cmr->themes, "var");
$cmr->page = $cmr->include_conf($cmr->get_path("tab") . "page/". $cmr->get_conf("cmr_default_pager") . "/" . $cmr->get_conf("cmr_page_config"), $cmr->page, "var");// =========== default config ==================
/*==================*/
/*==================*/
include($cmr->get_path("index") . "system/select_mode.php");//login, logout, forget_id, inscription, ..etc
/*==================*/
/*==================*/
include($cmr->get_path("index") . "system/init_mode.php");
empty($cmr->config["cmr_output_buffering"]) or ob_start(); // start output buffering// ob_start('cmr_callback');
include_once($cmr->get_path("func") . "function/databases/" . $cmr->get_conf("db_type") . ".php");
$cmr->db_connection = $cmr->connect();//or $cmr->config["cmr_guest_mode"]=0; //-----database connection------
if (!is_resource($cmr->db_connection)) $cmr->config["cmr_guest_mode"]=1;
/*==================*/
/*==================*/
if (empty($cmr->config["cmr_guest_mode"])&&(get_post("cmr_mode")!="guest_mode")) {
if (cmr_new_login($cmr->config, $cmr->user)) {// ======================get authentificazione first==================
include_once($cmr->get_path("lib") . "lib/lib_login.php");
include($cmr->get_path("index") . "system/load_user_data.php");
// $cmr->debug_print();exit;
@ include_once(($cmr->user["auth_group_path"]."login_rc.php"));// ===============file group login script================
@ include_once(($cmr->user["auth_user_path"]."login_rc.php"));// ===============file login user script=================
@ eval($cmr->user["auth_group_script"]);// ===============database login group script================
@ eval($cmr->user["auth_user_script"]);// ===============database login user script=================
$cmr->config = $cmr->include_conf($cmr->user["auth_group_path"] . $cmr->get_conf("cmr_home_config"), $cmr->config, "var");
$cmr->config = $cmr->include_conf($cmr->user["auth_user_path"] . $cmr->get_conf("cmr_home_config"), $cmr->config, "var");
$cmr->page = $cmr->include_conf($cmr->user["auth_group_path"] . $cmr->get_conf("cmr_page_config"), $cmr->page, "var");
$cmr->page = $cmr->include_conf($cmr->user["auth_user_path"] . $cmr->get_conf("cmr_page_config"), $cmr->page, "var");
$cmr->themes = $cmr->include_conf($cmr->get_path("theme") . "themes/".$cmr->page["auth_theme"] . "/" . $cmr->get_conf("cmr_themes_config"), $cmr->themes, "var");
$cmr->language = $cmr->include_conf($cmr->get_path("lang") . "languages/". $cmr->page["auth_lang"]. "/" . $cmr->get_conf("cmr_lang_config"), $cmr->language, "var");
$cmr->language = $cmr->include_conf($cmr->get_path("lang") . "languages/". $cmr->page["language"]. "/" . $cmr->get_conf("cmr_lang_config"), $cmr->language, "var");
if(!empty($cmr->action["next_lang"])) $cmr->language = $cmr->include_conf($cmr->get_conf("cmr_begin_lang_file"), $cmr->language, "var");
if(!empty($cmr->action["next_theme"])) $cmr->themes = $cmr->include_conf($cmr->get_conf("cmr_begin_theme_file"), $cmr->themes, "var");
if(!empty($cmr->action["next_page"])) $cmr->page = $cmr->include_conf($cmr->get_conf("cmr_begin_pager_file"), $cmr->page, "var");// =========== default config ==================
include($cmr->get_path("index") . "system/loader/login_to.php");
}else{
$cmr->user=cmr_load_session("user");
$cmr->session=cmr_load_session("session");
$cmr->db=cmr_load_session("db");
if(!empty($cmr->db[0]["db_host"])) $cmr->db_connection = connect_to_db($cmr->config, $cmr->db[0]);
include_once($cmr->get_path("func") . "system/control_session.php");
$cmr->load_session();
// $cmr->debug_print();exit;
}
include($cmr->get_path("index") . "system/get_send_data.php");
// $cmr->debug_print();exit;
update_messages($cmr->config, $cmr->db_connection); //Update ripetitive Message
}
/*==================*/
/*==================*/
if (!empty($cmr->config["cmr_guest_mode"])||(get_post("cmr_mode")=="guest_mode")) {
if (cmr_new_login($cmr->config, $cmr->user)) {// ======================get authentificazione first==================
$_SESSION["cmr_id"]=session_id();
include($cmr->get_path("index") . "system/load_guest_mode.php");
include_once(($cmr->user["auth_group_path"]."login_rc.php"));// ===============file group login script================
include_once(($cmr->user["auth_user_path"]."login_rc.php"));// ===============file login user script=================
$cmr->config = $cmr->include_conf($cmr->user["auth_group_path"] . $cmr->get_conf("cmr_home_config"), $cmr->config, "var");
$cmr->config = $cmr->include_conf($cmr->user["auth_user_path"] . $cmr->get_conf("cmr_home_config"), $cmr->config, "var");
$cmr->page = $cmr->include_conf($cmr->user["auth_group_path"] . $cmr->get_conf("cmr_page_config"), array(), "var");
$cmr->page = $cmr->include_conf($cmr->user["auth_user_path"] . $cmr->get_conf("cmr_page_config"), $cmr->page, "var");
$cmr->themes = $cmr->include_conf($cmr->get_path("theme") . "themes/".$cmr->page["auth_theme"] . "/" . $cmr->get_conf("cmr_themes_config"), $cmr->themes, "var");
$cmr->language = $cmr->include_conf($cmr->get_path("lang") . "languages/". $cmr->page["language"]. "/" . $cmr->get_conf("cmr_lang_config"), $cmr->language, "var");
include($cmr->get_path("index") . "system/get_send_data.php");
}else{
$cmr->load_session();
}
};
/*==================*/
/*==================*/
$cmr->post_var["cmr_module"] = get_post("cmr_module");
$cmr->post_var["cmr_lib"] = get_post("cmr_lib");
if ((!empty($cmr->post_var["cmr_module"]))||(!empty($cmr->post_var["cmr_lib"]))) {
// $cmr->post_files=get_post_files($cmr->config, $cmr->user, $cmr->post_files);
include_once($cmr->get_path("index") . "system/loader/loader_lib.php");
}
/*==================*/
/*==================*/
include_once($cmr->get_path("index") . "system/cron.php");
/*==================*/
/*==================*/
$cmr->session["pre_match"] = "";//$code1="1";
$cmr->page=layers_init($cmr->page, 1, $cmr->post_var["cmr_module"]);// print("head=$cmr->page["head_num_mod"];left=$cmr->page["left_num_mod"];middle=$cmr->page["middle_num_mod"];right=$cmr->page["right_num_mod"];foot=$cmr->page["foot_num_mod"]");
/*==================*/
// $cmr->debug_print();exit;
include($cmr->get_path("index") . "front_page.php");
/*==================*/
/*==================*/
empty($cmr->config["cmr_debug_mode"]) or $cmr->debug_print();
include($cmr->get_path("index") . "page_print.php");
$cmr->save_session();
empty($cmr->config["cmr_output_buffering"]) or ob_end_clean(); // clean buffer content
$doc_cli = strip_tags(($cmr->buffer), '<strong><high><medium><low><h1><option><b><i><a><ul><li><pre><hr><br><blockquote><img><p><table><tr><td>');
$trans = array("&nbsp;" => " ", "<br" => "\n<br", "<tr" => "\n<tr", "<td" => " | <td", "<h" => "\n<h", "<p" => "\n<p", "<option" => "\n<option", "<table" => "\n===================\n<table");
$doc_cli = strtr($doc_cli, $trans);
$doc_cli = strip_tags(($doc_cli));
print(($doc_cli));
$cmr->buffer = "";
/*=================================================================*/
?>