2009-03-12 Esteban Sanchez <estebans@artica.es>

* include/auth/mysql.php: Added a cache to is_user_admin().

	* include/config_process.php: Changed build version. Load l10n tables
	before extensions.
	
	* include/functions_config.php: Fixed an error on update_config() that
	fails to update when the value has changed. Fixed style updating
	also.

	* include/functions_db.php: Added GROUP BY token to
	format_array_to_where_clause_sql().

	* include/functions_ui.php: Added a flag to debug() to allow disabling
	the backtrace output.

	* operation/agentes/tactical.php: Fixed tab. Makes percentage images a
	bit taller.

	* ChangeLog.2008: Added to repository. Stripped ChangeLog history.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1525 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-03-12 09:20:49 +00:00
parent fe9fc060de
commit e79dd9af23
8 changed files with 7183 additions and 7145 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,13 @@ function process_user_login ($login, $pass) {
* @return bool True is the user is admin
*/
function is_user_admin ($id_user) {
return (bool) get_db_value ('is_admin', 'tusuario', 'id_user', $id_user);
static $is_admin = -1;
if ($is_admin !== -1)
return $is_admin;
$is_admin = (bool) get_db_value ('is_admin', 'tusuario', 'id_user', $id_user);
return $is_admin;
}

View File

@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//Pandora Version
$build_version = 'PC090305';
$build_version = 'PC090312';
$pandora_version = 'v3.0-dev';
$config['start_time'] = microtime (true);
@ -64,6 +64,15 @@ require_once ('functions_config.php');
process_config ();
require_once ('streams.php');
require_once ('gettext.php');
$l10n = NULL;
if (file_exists ('./include/languages/'.$config["language"].'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$config["language"].'.mo'));
$l10n->load_tables();
}
if (! defined ('EXTENSIONS_DIR'))
define ('EXTENSIONS_DIR', 'extensions');
@ -74,13 +83,4 @@ require_once ('functions_extensions.php');
$config['extensions'] = get_extensions ();
require_once ('streams.php');
require_once ('gettext.php');
$l10n = NULL;
if (file_exists ('./include/languages/'.$config["language"].'.mo')) {
$l10n = new gettext_reader (new CachedFileReader ('./include/languages/'.$config["language"].'.mo'));
$l10n->load_tables();
}
?>

View File

@ -48,7 +48,7 @@ function update_config_value ($token, $value) {
return (bool) create_config_value ($token, $value);
/* If it has not changed */
if ($config[$token] != $value)
if ($config[$token] == $value)
return true;
$config[$token] = $value;
@ -78,7 +78,7 @@ function update_config () {
return;
$style = (string) get_parameter ('style', $config["style"]);
$config["style"] = substr ($style, 0, strlen ($style) - 4);
$style = substr ($style, 0, strlen ($style) - 4);
/* Workaround for ugly language and language_code missmatch */
$config['language_code'] = (string) get_parameter ('language', $config["language"]);

View File

@ -1986,6 +1986,11 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal
unset ($values['order']);
}
if (isset ($values['group'])) {
$group = sprintf (' GROUP BY %s', $values['order']);
unset ($values['group']);
}
$i = 1;
$max = count ($values);
foreach ($values as $field => $value) {
@ -2022,7 +2027,7 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal
$i++;
}
return (! empty ($query) ? $prefix: '').$query.$order.$limit.$offset;
return (! empty ($query) ? $prefix: '').$query.$group.$order.$limit.$offset;
}
/**

View File

@ -837,8 +837,9 @@ function print_help_tip ($text, $return = false) {
* This functions need to have active $config['debug'] variable to work.
*
* @param mixed Variable name to debug
* @param bool Wheter to print the backtrace or not.
*/
function debug ($var) {
function debug ($var, $backtrace = true) {
global $config;
if (! isset ($config['debug']))
return;
@ -848,6 +849,7 @@ function debug ($var) {
$id++;
if ($backtrace) {
echo '<div class="debug">';
echo '<a href="#" onclick="$(\'#trace-'.$id.'\').toggle ();return false;">Backtrace</a>';
echo '<div id="trace-'.$id.'" class="backtrace invisible">';
@ -889,6 +891,7 @@ function debug ($var) {
}
echo '</ol>';
echo '</div></div>';
}
/* Actually print the variable given */
echo '<pre class="debug">';

View File

@ -187,7 +187,8 @@ if ($serverinfo) {
} else {
$percent = 0;
}
$data[2] = print_image ("reporting/fgraph.php?tipo=progress&percent=".$percent."&height=18&width=80", true, array ("title" => $server_info["modules"]." ".__('of')." ".$total_modules));
$data[2] = print_image ("reporting/fgraph.php?tipo=progress&percent=".$percent."&height=20&width=80",
true, array ("title" => $server_info["modules"]." ".__('of')." ".$total_modules));
$data[3] = $server_info["lag"]." / ".$server_info["module_lag"];