From: dj3c1t Date: Sat, 18 May 2013 15:27:56 +0000 (+0200) Subject: quelques ajouts / corrections X-Git-Tag: mtweb.0.8.0~2 X-Git-Url: http://git.dj3c1t.com/index.cgi?a=commitdiff_plain;h=4bc0f6efc262d712b5c6f09375548bf17cd1576d;p=mtweb quelques ajouts / corrections --- diff --git a/mw/app/data/impl/mw_mysql.php b/mw/app/data/impl/mw_mysql.php index 0cff0c2..991ac4d 100644 --- a/mw/app/data/impl/mw_mysql.php +++ b/mw/app/data/impl/mw_mysql.php @@ -48,6 +48,17 @@ return false; } + function field_exists($table_name, $field_name){ + if(!$this->link) $this->connect($this->host, $this->base, $this->user, $this->password); + $sql = "SHOW COLUMNS FROM `".$table_name."` LIKE ".$field_name; + $rst = $this->query($sql); + $exists = false; + $v_rst = $this->fetch_assoc($rst); + if($v_rst) $exists = true; + $this->free_result($rst); + return $exists; + } + function query($query_string){ if(!$this->link) $this->connect($this->host, $this->base, $this->user, $this->password); $result = @mysql_query($query_string, $this->link); diff --git a/mw/app/data/mw_sgbd.php b/mw/app/data/mw_sgbd.php index db65b2e..8c30d95 100644 --- a/mw/app/data/mw_sgbd.php +++ b/mw/app/data/mw_sgbd.php @@ -34,6 +34,17 @@ ); } + function field_exists($table_name, $field_name){ + return $this->sgbd_impl->field_exists( + ( + $prefix_codes = array_keys($this->env->bdd("table_prefix"))) ? + str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name) + : $table_name, + $field_name + ); + + } + function query($sql){ return $this->sgbd_impl->query( ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ? diff --git a/mw/app/mods/users/identification.php b/mw/app/mods/users/identification.php index 575ca6f..c7bd19a 100644 --- a/mw/app/mods/users/identification.php +++ b/mw/app/mods/users/identification.php @@ -13,7 +13,7 @@ "Vous êtes maintenant identifié en tant que ".$_POST['login'] ); } - else $env->message("Idantifiants incorrects"); + else $env->message("Identifiants incorrects"); } function logout(&$env){ diff --git a/mw/app/out/default/views/head.php b/mw/app/out/default/views/head.php index 390ce5b..b33f80b 100644 --- a/mw/app/out/default/views/head.php +++ b/mw/app/out/default/views/head.php @@ -7,6 +7,7 @@ + js_files() as $js_file) : ?> diff --git a/mw/app/out/default/views/users/colonne.php b/mw/app/out/default/views/users/colonne.php index e69de29..c3f854b 100644 --- a/mw/app/out/default/views/users/colonne.php +++ b/mw/app/out/default/views/users/colonne.php @@ -0,0 +1,5 @@ +data(); if(($users_menu = $data->get_link("users")) && $users_menu["subs"]) : ?> + + + + \ No newline at end of file