Bläddra i källkod

More Settings and fixes

Fixed #92 - Slim Tob Bar Setting added
Fixed #112 - Option to disable loading screen
Fixed #113 - Back button on login screen
More Fixes - Auto-login on account creation.  Added setting to enable
mail. Small CSS fixes.
causefx 9 år sedan
förälder
incheckning
443b067e13
10 ändrade filer med 452 tillägg och 218 borttagningar
  1. 1 4
      css/style.css
  2. 287 155
      index.php
  3. 5 0
      lang/de.ini
  4. 6 1
      lang/en.ini
  5. 6 1
      lang/es.ini
  6. 6 1
      lang/fr.ini
  7. 6 1
      lang/it.ini
  8. 6 1
      lang/nl.ini
  9. 118 47
      settings.php
  10. 11 7
      user.php

+ 1 - 4
css/style.css

@@ -4427,16 +4427,13 @@ body .ns-effect-loadingcircle {
   background: rgba(0, 0, 0, 0.2);
 }
 
-.logout-modal .login {
-  max-width: 320px;
-}
-
 .logout-modal .login a {
   font-size: 20px;
   padding: 20px;
   padding: 15px 25px 0px;
   color: #fff;
   opacity: .8;
+  cursor: pointer;
 }
 
 .logout-modal .login a:hover {

+ 287 - 155
index.php

@@ -254,6 +254,9 @@ else :
     if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
 
 endif;
+if(defined('SLIMBAR') && SLIMBAR == '') : define('SLIMBAR', 'true'); endif;
+
+if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
 
 ?>
 <!--
@@ -324,9 +327,233 @@ endif;
         <![endif]-->
         
     </head>
+    
+    <style>
+        .bottom-bnts a {
+
+            background: <?=$bottombar;?> !important;
+            color: <?=$topbartext;?> !important;
+
+        }.bottom-bnts {
+
+            background-color: <?=$bottombar;?> !important;
+
+        }.gn-menu-main {
+
+
+            background-color: <?=$topbar;?>;
+
+        }.gn-menu-main ul.gn-menu {
+
+            background: <?=$sidebar;?>;
+
+        }.gn-menu-wrapper {
+
+            background: <?=$sidebar;?>;
+
+        }.gn-menu i {
+
+            height: 18px;
+            width: 52px;
+
+        }.la-timer.la-dark {
+
+            color: <?=$topbartext;?>
+
+        }.refresh-preloader {
+
+            background: <?=$loading;?>;
+
+        }.la-timer {
+
+            width: 75px;
+            height: 75px;
+            padding-top: 20px;
+            border-radius: 100px;
+            background: <?=$sidebar;?>;
+            border: 2px solid <?=$topbar;?>;
+
+        }@media screen and (min-width:737px){
+
+            .tab-item:hover a {
+
+                color: <?=$hovertext;?> !important;
+                background: <?=$hoverbg;?>;
+                border-radius: 100px 0 0 100px;
+
+            }
+
+        }.gn-menu li.active > a {
+
+            color: <?=$activetabtext;?> !important;
+            background: <?=$activetabBG;?>;
+            border-radius: 100px 0 0 100px;
+
+        }.gn-menu li.rightActive > a {
+
+            background: <?=$hoverbg;?>;
+            border-radius: 100px 0 0 100px;
+
+        }.active {
+
+            display: block;
+
+        }.hidden {
+
+            display: none;
+
+        }.errorz {
+
+            background-image: linear-gradient(red, red), linear-gradient(#d2d2d2, #d2d2d2);
+            outline: none;
+            animation: input-highlight .5s forwards;
+            box-shadow: none;
+            padding-left: 0;
+            border: 0;
+            border-radius: 0;
+            background-size: 0 2px,100% 1px;
+            background-repeat: no-repeat;
+            background-position: center bottom,center calc(100% - 1px);
+            background-color: transparent;
+            box-shadow: none;
+
+        }.gn-menu li.active i.fa {
+
+            color: <?=$activetabicon;?>;
+
+        }.gn-menu li i.fa {
+
+            color: <?=$inactiveicon;?>;
+
+        }.gn-menu-main ul.gn-menu a {
+
+            color: <?=$inactivetext;?>;
+        }li.dropdown.some-btn .mdi {
+
+            color: <?=$topbartext;?>;
+
+        }.nav>li>a:focus, .nav>li>a:hover {
+
+            text-decoration: none;
+            background-color: transparent;
+
+        }div#preloader {
+
+            background-color: <?=$loading;?>;
+
+        }.iframe {
+
+            -webkit-overflow-scrolling: touch;
+
+        }.iframe iframe{
+
+        }#menu-toggle span {
+            background: <?=$topbartext;?>;
+        }logo.logo {
+
+            opacity: 0.5;
+            filter: alpha(opacity=50);
+
+        }.mini-nav .split {
+            width: calc(50% - 25px);
+        }.splitRight {
+            width: 50%;
+            margin-left: 50% !important;
+            position: absolute !important;
+        }.split {
+            width: 50%;
+            position: absolute !important;
+        }.mini-nav .splitRight {
+            margin-left: calc(50% + 25px) !important;
+            width: calc(50% - 25px);
+        }.form-control.material {
+            background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
+            background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
+            background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
+        }
+
+        <?php if(SLIMBAR == "true") : ?>
+        /* Slim Styling */
+        body{
+
+            padding-top: 30px !important;
+
+        }.gn-menu-main {
+        
+            height: 30px !important;
+        
+        }.gn-menu-wrapper {
+         
+            top: 30px !important;
+            
+        }.gn-menu-main .navbar-right {
+            
+            line-height: 30px !important;
+            
+        }img.img-circle {
+            
+            vertical-align: inherit;
+            margin-top: 2px;
+        
+        }.menu-toggle .hamburger {
+            
+            top: 0px !important;
+            
+        }.top-clock {
+            
+            line-height: 30px !important;
+            
+        }.titlelogoclass {
+            
+            vertical-align: inherit;
+            
+        }.members-sidebar {
+            
+            top: 30px !important;
+            
+        }.menu-toggle .cross span:nth-child(2) {
+        
+            left: -9px;
+            top: 40px;
+        
+        }.menu-toggle.gn-selected .cross span:nth-child(2) {
+         
+            width: 49%;
+            
+        }.menu-toggle.gn-selected .cross span:nth-child(1) {
+            
+            height: 105% !important;
+            
+        }.menu-toggle .cross span:nth-child(1) {
+         
+            left: 6px !important;
+            top: 26px !important;
+            
+        }.menu-toggle .hamburger span {
+         
+            margin: 5px 0;
+            width: 25px;
+            
+        }.menu-toggle .hamburger {
+            
+            margin-left: -17px;
+            
+        }.ns-effect-slidetop {
+         
+            padding: 5px 22px;
+            
+        }.ns-effect-exploader {
+         
+            padding: 5px 22px;
+            
+        }
+        <?php endif; ?>
+
+    </style>
 
     <body style="overflow: hidden">
 
+        <?php if (LOADINGSCREEN == "true") : ?>
         <!--Preloader-->
         <div id="preloader" class="preloader table-wrapper">
             
@@ -351,154 +578,9 @@ endif;
             </div>
         
         </div>
+        <?php endif; ?>
 
         <div id="main-wrapper" class="main-wrapper" tabindex="-1">
-            
-            <style>
-                .bottom-bnts a {
-                    
-                    background: <?=$bottombar;?> !important;
-                    color: <?=$topbartext;?> !important;
-                
-                }.bottom-bnts {
-                    
-                    background-color: <?=$bottombar;?> !important;
-                
-                }.gn-menu-main {
-                    
-                   
-                    background-color: <?=$topbar;?>;
-                
-                }.gn-menu-main ul.gn-menu {
-                    
-                    background: <?=$sidebar;?>;
-                
-                }.gn-menu-wrapper {
-                
-                    background: <?=$sidebar;?>;
-                
-                }.gn-menu i {
-                    
-                    height: 18px;
-                    width: 52px;
-                
-                }.la-timer.la-dark {
-                    
-                    color: <?=$topbartext;?>
-                
-                }.refresh-preloader {
-                    
-                    background: <?=$loading;?>;
-                
-                }.la-timer {
-                    
-                    width: 75px;
-                    height: 75px;
-                    padding-top: 20px;
-                    border-radius: 100px;
-                    background: <?=$sidebar;?>;
-                    border: 2px solid <?=$topbar;?>;
-                
-                }@media screen and (min-width:737px){
-                    
-                    .tab-item:hover a {
-                    
-                        color: <?=$hovertext;?> !important;
-                        background: <?=$hoverbg;?>;
-                        border-radius: 100px 0 0 100px;
-                    
-                    }
-        
-                }.gn-menu li.active > a {
-                    
-                    color: <?=$activetabtext;?> !important;
-                    background: <?=$activetabBG;?>;
-                    border-radius: 100px 0 0 100px;
-                
-                }.gn-menu li.rightActive > a {
-                    
-                    background: <?=$hoverbg;?>;
-                    border-radius: 100px 0 0 100px;
-                
-                }.active {
-                    
-                    display: block;
-                
-                }.hidden {
-                    
-                    display: none;
-                    
-                }.errorz {
-                	
-                	background-image: linear-gradient(red, red), linear-gradient(#d2d2d2, #d2d2d2);
-            	    outline: none;
-            	    animation: input-highlight .5s forwards;
-            	    box-shadow: none;
-            	    padding-left: 0;
-            	    border: 0;
-            	    border-radius: 0;
-            	    background-size: 0 2px,100% 1px;
-            	    background-repeat: no-repeat;
-            	    background-position: center bottom,center calc(100% - 1px);
-            	    background-color: transparent;
-            	    box-shadow: none;
-                	    
-                }.gn-menu li.active i.fa {
-                    
-                    color: <?=$activetabicon;?>;
-                    
-                }.gn-menu li i.fa {
-                    
-                    color: <?=$inactiveicon;?>;
-                    
-                }.gn-menu-main ul.gn-menu a {
-                    
-                    color: <?=$inactivetext;?>;
-                }li.dropdown.some-btn .mdi {
-                    
-                    color: <?=$topbartext;?>;
-                    
-                }.nav>li>a:focus, .nav>li>a:hover {
-                    
-                    text-decoration: none;
-                    background-color: transparent;
-                    
-                }div#preloader {
-                    
-                    background-color: <?=$loading;?>;
-                    
-                }.iframe {
-                    
-                    -webkit-overflow-scrolling: touch;
-
-                }.iframe iframe{
-
-                }#menu-toggle span {
-                    background: <?=$topbartext;?>;
-                }logo.logo {
-                    
-                    opacity: 0.5;
-                    filter: alpha(opacity=50);
-
-                }.mini-nav .split {
-                    width: calc(50% - 25px);
-                }.splitRight {
-                    width: 50%;
-                    margin-left: 50% !important;
-                    position: absolute !important;
-                }.split {
-                    width: 50%;
-                    position: absolute !important;
-                }.mini-nav .splitRight {
-                    margin-left: calc(50% + 25px) !important;
-                    width: calc(50% - 25px);
-                }.form-control.material {
-                    background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
-                    background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
-                    background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
-                }
-
-            </style>
 
             <ul id="gn-menu" class="gn-menu-main">
                 
@@ -632,7 +714,7 @@ endif;
                     
                         else : 
                     
-                            echo "<img style='max-width: 250px; max-height: 50px;' src='" . TITLELOGO . "'>";
+                            echo "<img class='titlelogoclass' style='max-width: 250px; max-height:" . $slimBar ."px;' src='" . TITLELOGO . "'>";
                     
                         endif;
                     
@@ -664,7 +746,7 @@ endif;
                                 
                             <?php endif; endif;?>
                                 
-                                <i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=40&d=mm" class="img-circle"></i> 
+                                <i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=<?=$userSize;?>&d=mm" class="img-circle"></i> 
                                 
                             </a>
                             
@@ -972,6 +1054,7 @@ endif;
 
                             <input type="hidden" name="op" value="update"/>
                             <input type="hidden" name="sha1" value=""/>
+                            <input type="hidden" name="username" value="<?php echo $USER->username; ?>"/>
                             <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
 
                             <div class="form-group">
@@ -1079,8 +1162,10 @@ endif;
 
                                     </form> 
                                     
+                                    <?php if (ENABLEMAIL == "true") : ?>
                                     <button id="switchForgot" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("FORGOT_PASSWORD");?></text></button>
-                                    
+                                    <?php endif; ?>
+    
                                     <?php if(REGISTERPASSWORD != "") : ?>
                                     <button id="switchCreateUser" style="background:<?=$hoverbg;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$hovertext;?>;"><?php echo $language->translate("CREATE_USER");?></text></button>
                                     <?php endif; ?>
@@ -1100,6 +1185,8 @@ endif;
 
                                     </form> 
                                     
+                                    <button id="welcomeGoBack" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
+                                    
                                     <?php if(REGISTERPASSWORD != "") : ?>
                                     <div id="userPassForm" style="display: none;">
                                         <form id="userCreateForm" action="register.php" method="POST">
@@ -1115,6 +1202,8 @@ endif;
 
                                             <button style="background:<?=$topbar;?>;" type="submit" id="checkRegisterPass" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT");?></text></button>
                                         </form>
+                                        
+                                        <button id="welcomeGoBack2" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
                                     
                                     </div>
                                     
@@ -1150,6 +1239,8 @@ endif;
                                         </div>
 
                                         <button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
+                                        
+                                        <button id="welcomeGoBack3" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
 
                                     </form> 
                                     <?php endif; ?>
@@ -1171,7 +1262,7 @@ endif;
         <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
         <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
             
-            <div class="table-wrapper" style="background: <?=$topbar;?>">
+            <div class="table-wrapper" style="background: <?=$sidebar;?>">
             
                 <div class="table-row">
                 
@@ -1181,14 +1272,22 @@ endif;
                         
                             <div class="content-box">
                             
-                                <div style="background:<?=$topbartext;?>;" class="biggest-box">
+                                <div style="background:<?=$topbar;?>;" class="biggest-box">
+                                    
+                                    <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
+                                    
+                                </div>
                                 
+                                <div class="big-box login-form">
+                                    
                                     <form name="log out" id="logout" action="" method="POST">
                                         
 				                        <input type="hidden" name="op" value="logout">
                                         
                                         <input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
-			
+			                         
+                                        <center><img src="images/sowwy.png" style="height: 200px;"></center>
+                                        
                                         <h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
                                         
                                         <a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
@@ -1255,9 +1354,9 @@ endif;
             
             windowHeight = $(window).innerHeight();
             
-            $("div").find(".iframe").css('height', windowHeight - 56 + "px");
+            $("div").find(".iframe").css('height', windowHeight - <?=$slimBar;?> + "px");
             
-            $('#content').css('height', windowHeight - 56 + "px");
+            $('#content').css('height', windowHeight - <?=$slimBar;?> + "px");
             
         };
             
@@ -1354,12 +1453,43 @@ endif;
      
         });
             
+        $("#welcomeGoBack").click(function(){
+            
+            $( "form[id^='login']" ).toggle();
+            $( "form[id^='forgotPassword']" ).toggle();
+            $("#switchForgot").toggle();
+            $("#switchCreateUser").toggle();
+            $("#welcomeGoBack").toggle();
+     
+        });
+            
+        $("#welcomeGoBack2").click(function(){
+            
+            $( "form[id^='login']" ).toggle();
+            $("#userPassForm").toggle();
+            $("#switchForgot").toggle();
+            $("#switchCreateUser").toggle();
+            $("#welcomeGoBack2").toggle();
+     
+        });
+            
+        $("#welcomeGoBack3").click(function(){
+            
+            $("#registration").toggle();  
+            $("#welcomeGoBack3").toggle();
+            $( "form[id^='login']" ).toggle();
+            $("#switchForgot").toggle();
+            $("#switchCreateUser").toggle();
+     
+        });
+            
         $("#switchForgot").click(function(){
 
             $( "form[id^='login']" ).toggle();
             $( "form[id^='forgotPassword']" ).toggle();
             $("#switchForgot").toggle();
             $("#switchCreateUser").toggle();
+            $("#welcomeGoBack").toggle();
      
         });
             
@@ -1369,6 +1499,7 @@ endif;
             $("#userPassForm").toggle();
             $("#switchForgot").toggle();
             $("#switchCreateUser").toggle();
+            $("#welcomeGoBack2").toggle();
      
         });  
             
@@ -1443,7 +1574,8 @@ endif;
                         } else {
 
                             $("#userPassForm").toggle();
-                            $("#registration").toggle();     
+                            $("#registration").toggle(); 
+                            $("#welcomeGoBack3").toggle();
 
                         }
 

+ 5 - 0
lang/de.ini

@@ -155,3 +155,8 @@ ENTER_PASSWORD_TO_REGISTER = "Registrierungspasswort eingeben"
 SUBMIT = "Absenden"
 REGISTER_PASSWORD = "Registrierungspasswort"
 NOTIFICATION_TYPE = "Benachrichtigungs-Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 6 - 1
lang/en.ini

@@ -154,4 +154,9 @@ CREATE_USER = "Create Account"
 ENTER_PASSWORD_TO_REGISTER = "Enter Password To Register"
 SUBMIT = "Submit"
 REGISTER_PASSWORD = "Registration Password"
-NOTIFICATION_TYPE = "Notification Style"
+NOTIFICATION_TYPE = "Notification Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 6 - 1
lang/es.ini

@@ -154,4 +154,9 @@ CREATE_USER = "Create Account"
 ENTER_PASSWORD_TO_REGISTER = "Enter Password To Register"
 SUBMIT = "Submit"
 REGISTER_PASSWORD = "Registration Password"
-NOTIFICATION_TYPE = "Notification Style"
+NOTIFICATION_TYPE = "Notification Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 6 - 1
lang/fr.ini

@@ -154,4 +154,9 @@ CREATE_USER = "Create Account"
 ENTER_PASSWORD_TO_REGISTER = "Enter Password To Register"
 SUBMIT = "Submit"
 REGISTER_PASSWORD = "Registration Password"
-NOTIFICATION_TYPE = "Notification Style"
+NOTIFICATION_TYPE = "Notification Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 6 - 1
lang/it.ini

@@ -154,4 +154,9 @@ CREATE_USER = "Create Account"
 ENTER_PASSWORD_TO_REGISTER = "Enter Password To Register"
 SUBMIT = "Submit"
 REGISTER_PASSWORD = "Registration Password"
-NOTIFICATION_TYPE = "Notification Style"
+NOTIFICATION_TYPE = "Notification Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 6 - 1
lang/nl.ini

@@ -154,4 +154,9 @@ CREATE_USER = "Create Account"
 ENTER_PASSWORD_TO_REGISTER = "Enter Password To Register"
 SUBMIT = "Submit"
 REGISTER_PASSWORD = "Registration Password"
-NOTIFICATION_TYPE = "Notification Style"
+NOTIFICATION_TYPE = "Notification Style"
+ENABLE_LOADING_SCREEN = "Loading Screen"
+ENABLE_MAIL = "Enable Mail"
+PROMOTE = "Promote"
+DEMOTE = "Demote"
+ENABLE_SLIMBAR = "Enable Slim Bar"

+ 118 - 47
settings.php

@@ -129,18 +129,18 @@ endforeach;
 if($hasOptions == "No") :
 
     $title = "Organizr";
-    $topbar = "#eb6363"; 
-    $topbartext = "#FFFFFF";
-    $bottombar = "#eb6363";
-    $sidebar = "#000000";
-    $hoverbg = "#eb6363";
-    $hovertext = "#000000";
-    $activetabBG = "#eb6363";
+    $topbar = "#333333"; 
+    $topbartext = "#66D9EF";
+    $bottombar = "#333333";
+    $sidebar = "#393939";
+    $hoverbg = "#AD80FD";
+    $activetabBG = "#F92671";
     $activetabicon = "#FFFFFF";
     $activetabtext = "#FFFFFF";
-    $inactiveicon = "#FFFFFF";
-    $inactivetext = "#FFFFFF";
-    $loading = "#000000";
+    $inactiveicon = "#66D9EF";
+    $inactivetext = "#66D9EF";
+    $loading = "#66D9EF";
+    $hovertext = "#000000";
 
 endif;
 
@@ -1026,7 +1026,7 @@ endif;
                                         
                                         <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
                                               
-                                            <input type="hidden" name="op" value="unregister"/>
+                                            
                                             
                                             <p id="inputUsername"></p>
 
@@ -1060,7 +1060,7 @@ endif;
 
                                                         <?php $countUsers = 1; 
                                                         foreach($gotUsers as $row) : 
-                                                        if($row['role'] == "admin") : 
+                                                        if($row['role'] == "admin" && $countUsers == 1) : 
                                                             $userColor = "red";
                                                             $disableAction = "disabled=\"disabled\"";
                                                         else : 
@@ -1103,6 +1103,26 @@ endif;
                                                                     <span class="btn-label"><i class="fa fa-user-times"></i></span><?php echo $language->translate("DELETE");?>
 
                                                                 </button>
+                                                                
+                                                                <?php if ($row['role'] == "user") : ?>
+                                                                
+                                                                <button class="btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float promoteUser">
+
+                                                                    <span class="btn-label"><i class="fa fa-arrow-up"></i></span><?php echo $language->translate("PROMOTE");?>
+
+                                                                </button>
+                                                                
+                                                                <?php endif; ?>
+                                                                
+                                                                <?php if ($row['role'] == "admin") : ?>
+                                                                
+                                                                <button <?=$disableAction;?> class="btn waves btn-labeled btn-warning btn btn-sm text-uppercase waves-effect waves-float demoteUser">
+
+                                                                    <span class="btn-label"><i class="fa fa-arrow-down"></i></span><?php echo $language->translate("DEMOTE");?>
+
+                                                                </button>
+                                                                
+                                                                <?php endif; ?>
 
                                                             </td>
 
@@ -1136,47 +1156,49 @@ endif;
 
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="databaseLocation" placeholder="<?php echo $language->translate("DATABASE_PATH");?>" autocorrect="off" autocapitalize="off" value="<?php echo DATABASE_LOCATION;?>">
+                                                        <input type="text" class="form-control material input-sm" name="databaseLocation" placeholder="<?php echo $language->translate("DATABASE_PATH");?>" autocorrect="off" autocapitalize="off" value="<?php echo DATABASE_LOCATION;?>">
                                                         <p class="help-text"><?php echo $language->translate("DATABASE_PATH");?></p>
 
                                                     </div>
 
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="timezone" placeholder="<?php echo $language->translate("SET_TIMEZONE");?>" value="<?php echo TIMEZONE;?>">
+                                                        <input type="text" class="form-control material input-sm" name="timezone" placeholder="<?php echo $language->translate("SET_TIMEZONE");?>" value="<?php echo TIMEZONE;?>">
                                                         <p class="help-text"><?php echo $language->translate("SET_TIMEZONE");?></p>
 
                                                     </div>
 
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="titleLogo" placeholder="<?php echo $language->translate("LOGO_URL_TITLE");?>" value="<?php echo TITLELOGO;?>">
+                                                        <input type="text" class="form-control material input-sm" name="titleLogo" placeholder="<?php echo $language->translate("LOGO_URL_TITLE");?>" value="<?php echo TITLELOGO;?>">
                                                         <p class="help-text"><?php echo $language->translate("LOGO_URL_TITLE");?></p>
 
                                                     </div>
 
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="loadingIcon" placeholder="<?php echo $language->translate("LOADING_ICON_URL");?>" value="<?php echo LOADINGICON;?>">
+                                                        <input type="text" class="form-control material input-sm" name="loadingIcon" placeholder="<?php echo $language->translate("LOADING_ICON_URL");?>" value="<?php echo LOADINGICON;?>">
                                                         <p class="help-text"><?php echo $language->translate("LOADING_ICON_URL");?></p>
 
                                                     </div>
                                                     
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="cookiePassword" placeholder="<?php echo $language->translate("COOKIE_PASSWORD");?>" value="<?php echo COOKIEPASSWORD;?>">
+                                                        <input type="text" class="form-control material input-sm" name="cookiePassword" placeholder="<?php echo $language->translate("COOKIE_PASSWORD");?>" value="<?php echo COOKIEPASSWORD;?>">
                                                         <p class="help-text"><?php echo $language->translate("COOKIE_PASSWORD");?></p>
 
                                                     </div>
                                                     
                                                     <div class="form-group">
 
-                                                        <input type="text" class="form-control material" name="registerPassword" placeholder="<?php echo $language->translate("REGISTER_PASSWORD");?>" value="<?php echo REGISTERPASSWORD;?>">
+                                                        <input type="text" class="form-control material input-sm" name="registerPassword" placeholder="<?php echo $language->translate("REGISTER_PASSWORD");?>" value="<?php echo REGISTERPASSWORD;?>">
                                                         <p class="help-text"><?php echo $language->translate("REGISTER_PASSWORD");?></p>
 
                                                     </div>
                                                     
-                                                    <div class="form-group">
+                                                    <div class="content-form form-inline">
+                                                        
+                                                        <div class="form-group">
 
                                                         <?php 
                                                         
@@ -1192,37 +1214,70 @@ endif;
                                                         if($notifyExplode[1] == "thumbslider") : $thumbsliderActive = "selected"; else : $thumbsliderActive = ""; endif;
                                                         
                                                         ?>
-                                                        <select id="notifyValue" style="background-color: #273238 !important; width: 90%; float: left;" name="notifyEffect" id="notifyEffect" class="form-control material" required>
-                                                            
-                                                            <option value="bar-slidetop" <?=$slidetopActive;?>>Slide From Top</option>
-                                                            <option value="bar-exploader" <?=$exploaderActive;?>>Exploader From Top</option>
-                                                            <option value="attached-flip" <?=$flipActive;?>>Flip</option>
-                                                            <option value="attached-bouncyflip" <?=$bouncyflipActive;?>>Bouncy Flip</option>
-                                                            <option value="growl-scale" <?=$scaleActive;?>>Growl Scale</option>
-                                                            <option value="growl-genie" <?=$genieActive;?>>Growl Genie</option>
-                                                            <option value="growl-jelly" <?=$jellyActive;?>>Growl Jelly</option>
-                                                            <option value="growl-slide" <?=$slideActive;?>>Growl Slide</option>
-                                                            <option value="other-boxspinner" <?=$boxspinnerActive;?>>Spinning Box</option>
-                                                            <option value="other-thumbslider" <?=$thumbsliderActive;?>>Sliding</option>
-                                                            
-                                                        </select>
-                                                        
-                                                        <button id="notifyTest" type="button" class="class='btn waves btn-labeled btn-success btn pull-right text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-flask"></i></span>Test</button>
-                                                        
-                                                        <p class="help-text"><?php echo $language->translate("NOTIFICATION_TYPE");?></p>
+                                                            <select id="notifyValue" style="background-color: #273238 !important;" name="notifyEffect" id="notifyEffect" class="form-control material input-sm" required>
 
-                                                    </div>
-                                                    
-                                                    <div class="form-group">
-                                                        <?php  if(MULTIPLELOGIN == "true") : $multipleLogin = "checked"; else : $multipleLogin = ""; endif;?>
-                                                        <input id="" class="switcher switcher-success" value="false" name="multipleLogin" type="hidden">
-                                                        <input id="multipleLogin" class="switcher switcher-success" value="true" name="multipleLogin" type="checkbox" <?php echo $multipleLogin;?>>
+                                                                <option value="bar-slidetop" <?=$slidetopActive;?>>Slide From Top</option>
+                                                                <option value="bar-exploader" <?=$exploaderActive;?>>Exploader From Top</option>
+                                                                <option value="attached-flip" <?=$flipActive;?>>Flip</option>
+                                                                <option value="attached-bouncyflip" <?=$bouncyflipActive;?>>Bouncy Flip</option>
+                                                                <option value="growl-scale" <?=$scaleActive;?>>Growl Scale</option>
+                                                                <option value="growl-genie" <?=$genieActive;?>>Growl Genie</option>
+                                                                <option value="growl-jelly" <?=$jellyActive;?>>Growl Jelly</option>
+                                                                <option value="growl-slide" <?=$slideActive;?>>Growl Slide</option>
+                                                                <option value="other-boxspinner" <?=$boxspinnerActive;?>>Spinning Box</option>
+                                                                <option value="other-thumbslider" <?=$thumbsliderActive;?>>Sliding</option>
+
+                                                            </select>
+
+                                                            <button id="notifyTest" type="button" class="class='btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-flask"></i></span>Test</button>
+
+                                                            <p class="help-text"><?php echo $language->translate("NOTIFICATION_TYPE");?></p>
 
-                                                        <label for="multipleLogin"></label><?php echo $language->translate("MULTIPLE_LOGINS");?>
+                                                        </div>
                                                     
                                                     </div>
+                                                    
+                                                    <div class="content-form form-inline">
+                                                    
+                                                        <div class="form-group">
+                                                            <?php  if(MULTIPLELOGIN == "true") : $multipleLogin = "checked"; else : $multipleLogin = ""; endif;?>
+                                                            <input id="" class="switcher switcher-success" value="false" name="multipleLogin" type="hidden">
+                                                            <input id="multipleLogin" class="switcher switcher-success" value="true" name="multipleLogin" type="checkbox" <?php echo $multipleLogin;?>>
 
-                                                    <button type="submit" class="btn btn-success btn-icon waves waves-circle waves-effect waves-float"><i class="fa fa-floppy-o"></i></button>
+                                                            <label for="multipleLogin"></label><?php echo $language->translate("MULTIPLE_LOGINS");?>
+
+                                                        </div>
+                                                        
+                                                        <div class="form-group">
+                                                            <?php  if(LOADINGSCREEN == "true") : $loadingScreen = "checked"; else : $loadingScreen = ""; endif;?>
+                                                            <input id="" class="switcher switcher-success" value="false" name="loadingScreen" type="hidden">
+                                                            <input id="loadingScreen" class="switcher switcher-success" value="true" name="loadingScreen" type="checkbox" <?php echo $loadingScreen;?>>
+
+                                                            <label for="loadingScreen"></label><?php echo $language->translate("ENABLE_LOADING_SCREEN");?>
+
+                                                        </div>
+                                                        
+                                                        <div class="form-group">
+                                                            <?php  if(ENABLEMAIL == "true") : $enableMail = "checked"; else : $enableMail = ""; endif;?>
+                                                            <input id="" class="switcher switcher-success" value="false" name="enableMail" type="hidden">
+                                                            <input id="enableMail" class="switcher switcher-success" value="true" name="enableMail" type="checkbox" <?php echo $enableMail;?>>
+
+                                                            <label for="enableMail"></label><?php echo $language->translate("ENABLE_MAIL");?>
+
+                                                        </div>
+                                                        
+                                                        <div class="form-group">
+                                                            <?php  if(SLIMBAR == "true") : $enableSlimBar = "checked"; else : $enableSlimBar = ""; endif;?>
+                                                            <input id="" class="switcher switcher-success" value="false" name="slimBar" type="hidden">
+                                                            <input id="slimBar" class="switcher switcher-success" value="true" name="slimBar" type="checkbox" <?php echo $enableSlimBar;?>>
+
+                                                            <label for="slimBar"></label><?php echo $language->translate("ENABLE_SLIMBAR");?>
+
+                                                        </div>
+                                                        
+                                                    </div>
+                                                    
+                                                    <button type="submit" class="class='btn waves btn-labeled btn-success btn btn-sm pull-right text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-floppy-o"></i></span>Save</button>
 
                                                 </form>               
                                           
@@ -2175,7 +2230,23 @@ endif;
 
                 var parent_id = $(this).parent().attr('id');
                 editUsername = $('#unregister').find('#inputUsername');
-                $(editUsername).html('<input type="hidden" name="username"value="' + parent_id + '" />');
+                $(editUsername).html('<input type="hidden" name="op" value="unregister"/><input type="hidden" name="username"value="' + parent_id + '" />');
+     
+            });
+            
+            $(".promoteUser").click(function(){
+
+                var parent_ids = $(this).parent().attr('id');
+                editUsername = $('#unregister').find('#inputUsername');
+                $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="admin"/><input type="hidden" name="username"value="' + parent_ids + '" />');
+     
+            });
+            
+            $(".demoteUser").click(function(){
+
+                var parent_idz = $(this).parent().attr('id');
+                editUsername = $('#unregister').find('#inputUsername');
+                $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="user"/><input type="hidden" name="username"value="' + parent_idz + '" />');
      
             });
             
@@ -2460,7 +2531,7 @@ endif;
                 dataType: "json",
                 success: function(github) {
                    
-                    var currentVersion = "0.99994";
+                    var currentVersion = "0.99995";
                     var githubVersion = github.tag_name;
                     var githubDescription = github.body;
                     var githubName = github.name;

+ 11 - 7
user.php

@@ -14,6 +14,9 @@
     if(!empty($databaseConfig['titleLogo'])) : define('TITLELOGO', $databaseConfig['titleLogo']); else : define('TITLELOGO', ''); endif;
     if(!empty($databaseConfig['loadingIcon'])) : define('LOADINGICON', $databaseConfig['loadingIcon']); else : define('LOADINGICON', ''); endif;
     if(!empty($databaseConfig['multipleLogin'])) : define('MULTIPLELOGIN', $databaseConfig['multipleLogin']); else : define('MULTIPLELOGIN', 'false'); endif;
+    if(!empty($databaseConfig['enableMail'])) : define('ENABLEMAIL', $databaseConfig['enableMail']); else : define('ENABLEMAIL', 'false'); endif;
+    if(!empty($databaseConfig['loadingScreen'])) : define('LOADINGSCREEN', $databaseConfig['loadingScreen']); else : define('LOADINGSCREEN', 'true'); endif;
+    if(!empty($databaseConfig['slimBar'])) : define('SLIMBAR', $databaseConfig['slimBar']); else : define('SLIMBAR', 'true'); endif;
     if(!empty($databaseConfig['cookiePassword'])) : define('COOKIEPASSWORD', $databaseConfig['cookiePassword']); else : define('COOKIEPASSWORD', ''); endif;
     if(!empty($databaseConfig['registerPassword'])) : define('REGISTERPASSWORD', $databaseConfig['registerPassword']); else : define('REGISTERPASSWORD', ''); endif;
     if(!empty($databaseConfig['notifyEffect'])) : define('NOTIFYEFFECT', $databaseConfig['notifyEffect']); else : define('NOTIFYEFFECT', 'bar-slidetop'); endif;
@@ -38,7 +41,7 @@
 			// notification emails to work. Also note that password resetting doesn't work
 			// unless mail notification is turned on.
 
-			const use_mail = true;
+			const use_mail = ENABLEMAIL;
 
 			// This value should point to a directory that is not available to web users.
 			// If your documents are in ./public_html, for instance., then put database
@@ -341,9 +344,10 @@ EOT;
 		function update()
 		{
 			// get relevant values
-			$email = trim($_POST["email"]);
-			$sha1 = trim($_POST["sha1"]);
-            $role = trim($_POST["role"]);
+            @$username = trim($_POST["username"]);
+			@$email = trim($_POST["email"]);
+			@$sha1 = trim($_POST["sha1"]);
+            @$role = trim($_POST["role"]);
 			// step 1: someone could have bypassed the javascript validation, so validate again.
 			if($email !="" && preg_match(User::emailregexp, $email)==0) {
 				$this->info("registration error: email address did not pass validation");
@@ -352,7 +356,7 @@ EOT;
 				$this->info("registration error: password did not pass validation");
 				return false; }
 			// step 2: if validation passed, update the user's information
-			return $this->update_user($email, $sha1, $role);
+			return $this->update_user($username, $email, $sha1, $role);
 		}
 
 		/**
@@ -600,6 +604,7 @@ EOT;
 				$this->info("created user directory $dir");
 				// if there is a callback, call it
 				if($registration_callback !== false) { $registration_callback($username, $email, $dir); }
+                $this->login_user($username, $sha1, true);
 				return true; }
 			$this->error = "unknown database error occured.";
             $this->error("unknown database error occured.");
@@ -688,9 +693,8 @@ EOT;
 		/**
 		 * Update a user's information
 		 */
-		function update_user($email, $sha1, $role)
+		function update_user($username, $email, $sha1, $role)
 		{
-			$username = $_SESSION["username"];
 			if($email !="") {
 				$update = "UPDATE users SET email = '$email' WHERE username = '$username'";
 				$this->database->exec($update); }