noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 02/04: If administrator connects without havi


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 02/04: If administrator connects without having a profile, he gets the default one
Date: Mon, 13 Jul 2015 05:21:00 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit b7f59027d942c7cd6786242a82fc346c48a5fd26
Author: Dany De Bontridder <address@hidden>
Date:   Mon Jul 13 06:50:44 2015 +0200

    If administrator connects without having a profile, he gets the default one
---
 include/ac_common.php |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/ac_common.php b/include/ac_common.php
index 2c24781..b093a0e 100644
--- a/include/ac_common.php
+++ b/include/ac_common.php
@@ -915,8 +915,17 @@ function find_default_module()
                        */
                        if (empty ($default_module))
                        {
-                               echo_warning(_("Utilisateur n'a pas de profil, 
votre administrateur doit en configurer un dans CFGSEC"));
-                               exit();
+                            /* 
+                             * If administrateur, then we insert a default 
profile (1)
+                             * for him
+                             */
+                            if ( $g_user->admin == 1 )
+                            {
+                                $cn->exec_sql('insert into 
profile_user(user_name,p_id) values ($1,1) ',array($g_user->login));
+                                return find_default_module();
+                            }
+                            echo_warning(_("Utilisateur n'a pas de profil, 
votre administrateur doit en configurer un dans CFGSEC"));
+                            exit();
                        }
                }
                return $default_module[0]['me_code'];



reply via email to

[Prev in Thread] Current Thread [Next in Thread]