فهرست منبع

Bug Fix Galore

See Release notes for 0.95
causefx 9 سال پیش
والد
کامیت
159e31bce1
6فایلهای تغییر یافته به همراه312 افزوده شده و 58 حذف شده
  1. 140 0
      check.php
  2. 11 7
      css/style.css
  3. 104 14
      index.php
  4. 6 4
      js/menu/gnmenu.js
  5. 2 2
      js/user.js
  6. 49 31
      settings.php

+ 140 - 0
check.php

@@ -0,0 +1,140 @@
+<?php
+
+function check($extension) {
+    
+    if (extension_loaded($extension)) : 
+    
+        echo '<div class="panel panel-success">';
+        echo '<div class="panel-heading">';
+        echo '<h3 class="panel-title">'. $extension . '</h3>';
+        echo '</div>';
+        echo '<div style="color: gray" class="panel-body">';
+        echo $extension . ' is loaded and ready to rock-n-roll!  Good 2 Go!';
+        echo '</div></div>'; 
+    
+    else :
+    
+        echo '<div class="panel panel-danger">';
+        echo '<div class="panel-heading">';
+        echo '<h3 class="panel-title">'. $extension . '</h3>';
+        echo '</div>';
+        echo '<div style="color: gray" class="panel-body">';
+        echo $extension . ' is NOT loaded!  Please install it before proceeding';
+        
+        if($extension == "PDO_SQLITE") :
+            
+            echo '<br/> If you are on Windows, please uncomment this line in php.ini: ;extension=php_pdo_sqlite.dll';
+        
+        endif;
+    
+        echo '</div></div>'; 
+    
+    endif;  
+    
+}
+
+function getFilePermission($file) {
+        
+    if (file_exists($file)) :
+    
+        $length = strlen(decoct(fileperms($file)))-3;
+    
+        if($file{strlen($file)-1}=='/') :
+
+            $name = "Folder";
+
+        else :
+
+            $name = "File";
+
+        endif;
+
+        if (is_writable($file)) :
+
+            echo '<div class="panel panel-success">';
+            echo '<div class="panel-heading">';
+            echo '<h3 class="panel-title">'. $file . '<permissions style="float: right;">Permissions: ' . substr(decoct(fileperms($file)),$length) . '</permissions></h3>';
+            echo '</div>';
+            echo '<div style="color: gray" class="panel-body">';
+            echo $file . ' is writable and ready to rock-n-roll!  Good 2 Go!';
+            echo '</div></div>'; 
+
+        else :
+
+            echo '<div class="panel panel-danger">';
+            echo '<div class="panel-heading">';
+            echo '<h3 class="panel-title">'. $file . '</h3>';
+            echo '</div>';
+            echo '<div style="color: gray" class="panel-body">';
+            echo $file . ' is NOT writable!  Please change the permissions to make it writtable by the PHP User.';
+            echo '</div></div>'; 
+
+        endif;
+        
+    endif;
+}
+
+$db = dirname(__DIR__, 1) . "/users.db";
+$folder = dirname(__DIR__, 1) . "/users/";
+
+?>
+
+<!DOCTYPE html>
+
+<html lang="en" class="no-js">
+
+    <head>
+        
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge">
+        <meta name="msapplication-tap-highlight" content="no" />
+
+        <title>Requirement Checker</title>
+
+        <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
+        <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
+        <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
+        <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
+        <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css"> 
+        <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css"> 
+
+        <link rel="stylesheet" href="js/selects/cs-select.css">
+        <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
+
+
+        <link rel="stylesheet" href="css/style.css">
+
+        <link rel="icon" href="img/favicon.ico" type="image/x-icon" />
+        <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon" />
+        
+    </head>
+
+    <body class="gray-bg" style="padding: 20px;">
+
+        <div id="main-wrapper" class="main-wrapper">
+
+            <!--Content-->
+            <div id="content"  style="margin:0 20px; overflow:hidden">
+                
+                <h1><center>Check Persmissions</center></h1>
+                
+                <?php
+                
+                check("PDO_SQLITE");
+                check("PDO");
+
+                getFilePermission($db);
+                getFilePermission($folder);
+                getFilePermission((__DIR__));
+                getFilePermission(dirname(__DIR__, 1));
+
+                ?>
+
+            </div>
+
+        </div>
+
+    </body>
+
+</html>

+ 11 - 7
css/style.css

@@ -493,7 +493,7 @@ a.text-info:hover {
 }
 
 .gn-menu-main .navbar-right a {
-  padding: 0 20px !important;
+  padding: 0 10px 0 0 !important;
   font-size: 18px;
 }
 
@@ -797,10 +797,12 @@ input.gn-search:focus {
   line-height: 56px;
   font-size: 24px;
   font-weight: 300;
-  width: 120px;
+  left: 56px;
+  right: 56px;
   position: absolute;
-  left: 50%;
-  margin-left: -60px;
+  /*left: 50%;
+  width: 100%;
+  margin-left: -60px;*/
   top: 0;
 }
 
@@ -1689,10 +1691,12 @@ body {
 
 .tabs-with-bg {
   background: #e7ebec;
+  border-radius: 6px;
 }
 
 .tabs-with-bg .nav-tabs {
   border-bottom: 0;
+  border-radius: 6px 6px 0 0;
   text-align: center;
   -webkit-box-shadow: 1px 0 1px -1px rgba(0, 0, 0, 0.2);
           box-shadow: 1px 0 1px -1px rgba(0, 0, 0, 0.2);
@@ -4380,7 +4384,7 @@ body .ns-effect-loadingcircle {
 }
 
 .ultra-widget.blue-bg .w-used {
-  background-color: #4c9be8;
+  /*background-color: #4c9be8;*/
 }
 
 .ultra-widget.yellow-bg .w-used {
@@ -5966,7 +5970,7 @@ label {
 }
 
 .gn-menu-main .notifications > a:focus {
-  background-color: #4c9be8 !important;
+  /*background-color: #4c9be8 !important;*/
 }
 
 .gn-menu-main .notifications ul {
@@ -5983,7 +5987,7 @@ label {
 
 .no-touch .gn-menu-main a:hover,
 .no-touch .gn-search-item:hover {
-  background: #4c9be8;
+  /*background: #4c9be8;*/
   color: #fff;
 }
 

+ 104 - 14
index.php

@@ -134,6 +134,8 @@ elseif($hasOptions == "No") :
 
 endif;
 
+$userpic = md5( strtolower( trim( $USER->email ) ) );
+
 ?>
 
 <!DOCTYPE html>
@@ -422,10 +424,10 @@ endif;
                             <!--<li class="tab-item profile" id="settings.phpx"><i class="mdi mdi-account"></i></li>-->
                             <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
                             <?php if(!$USER->authenticated) : ?>
-                            <a class="log-in"><i class="mdi mdi-login"></i></a>
+                            <a class="log-in"><i class="fa fa-sign-in"></i></a>
                             <?php endif ?>
                             <?php if($USER->authenticated) : ?>
-                            <a class="logout"><i class="mdi mdi-logout"></i></a>
+                            <a class="logout"><i class="fa fa-sign-out"></i></a>
                             <?php endif ?>
                         
                         </div>
@@ -444,6 +446,16 @@ endif;
                     
                     <ul class="nav navbar-right right-menu">
                         
+                        <li class="dropdown notifications">
+                            
+                            <a class="show-members">
+                                
+                                <i class="userpic"><img style="border-radius: 50px;" src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=40&d=mm" class="userpic"></i> 
+                                
+                            </a>
+                            
+                        </li>
+                        
                         <li class="dropdown some-btn">
                             
                             <a class="fullscreen">
@@ -495,14 +507,14 @@ endif;
 								
 								                        <h4 class="text-center">Create an account for Admin Access</h4>
 								
-                        								<form class="controlbox" name="new user registration" id="registration" action="" method="POST">
+                        								<form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
                         								    
                         								    <input type="hidden" name="op" value="register"/>
                         								    <input type="hidden" name="sha1" value=""/>
                         								
                         								    <div class="form-group">
                         								
-                        								        <input type="text" class="form-control material" name="username" placeholder="Username" autocorrect="off" autocapitalize="off" value="" autofocus>
+                        								        <input type="text" class="form-control material" name="username" autofocus placeholder="Username" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
                         								
                         								    </div>
                         								
@@ -514,7 +526,7 @@ endif;
                         								
                         								    <div class="form-group">
                         								
-                        								        <input type="password" class="form-control material" name="password1" placeholder="Password">
+                        								        <input type="password" class="form-control material" name="password1" placeholder="Password" data-smk-strongPass="weak" required>
                         								
                         								    </div>
                         								
@@ -524,7 +536,7 @@ endif;
                         								
                         								    </div>
                         								
-                        								    <input type="button" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register" onclick="User.processRegistration()"/>
+                        								    <input id="registerSubmit" type="button" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register">
                         								
                         								</form>
 								                    
@@ -622,7 +634,58 @@ endif;
 
             <!--Welcome notification-->
             <div id="welcome"></div>
+            
+            <div id="members-sidebar" class="gray-bg members-sidebar">
+                
+                <h4 class="pull-left zero-m"><?php echo strtoupper($USER->username); ?> Options</h4>
+                
+                <span class="close-members-sidebar"><i class="fa fa-remove pull-right"></i></span>
+                
+                <div class="clearfix"><br/></div>
+                
+                <?php if($USER->authenticated) : ?>
+                         
+                <form class="content-form form-inline" name="update" id="update" action="" method="POST">
+
+                    <input type="hidden" name="op" value="update"/>
+                    <input type="hidden" name="sha1" value=""/>
+                    <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
 
+                    <div class="form-group">
+
+                        <input autocomplete="off" type="text" value="<?php echo $USER->email; ?>" class="form-control" name="email" placeholder="E-mail Address">
+
+                    </div>
+
+                    <br><br>
+
+                    <div class="form-group">
+
+                        <input autocomplete="off" type="password" class="form-control" name="password1" placeholder="Password">
+
+                    </div>
+
+                    <br><br>
+
+                    <div class="form-group">
+
+                        <input autocomplete="off" type="password" class="form-control" name="password2" placeholder="Password Again">
+
+                    </div>
+
+                    <br><br>
+
+                    <div class="form-group">
+
+                        <input type="button" class="btn btn-success text-uppercase waves-effect waves-float" value="Update" onclick="User.processUpdate()"/>
+
+                    </div>
+
+                </form> 
+
+                <?php endif;?>
+                
+            </div>
 
         </div>
         <?php if(!$USER->authenticated) : ?>
@@ -654,23 +717,23 @@ endif;
                                     
                                     <h4 class="text-center">Login</h4>
                                     
-                                    <form name="log in" id="login" action="" method="POST">
+                                    <form name="log in" id="login" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
                                         
                                         <div class="form-group">
                                             
                                             <input type="hidden" name="op" value="login">
 				                            <input type="hidden" name="sha1" value="">
-                                            <input type="text" class="form-control material" name="username" placeholder="Username" autocorrect="off" autocapitalize="off" value="" autofocus>
+                                            <input type="text" class="form-control material" name="username" placeholder="Username" autocorrect="off" autocapitalize="off" value="" autofocus required>
                                         
                                         </div>
                                         
                                         <div class="form-group">
                                             
-                                            <input type="password" class="form-control material" name="password1" placeholder="Password">
+                                            <input type="password" class="form-control material" name="password1" placeholder="Password" required>
                                         
                                         </div>
 
-                                        <button style="background:<?=$topbartext;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbar;?>;">Login</text></button>
+                                        <button id="loginSubmit" style="background:<?=$topbartext;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbar;?>;">Login</text></button>
 
                                     </form>                                   
                                     
@@ -774,6 +837,31 @@ endif;
             
         };
             
+        $('#loginSubmit').click(function() {
+            
+            if ($('#login').smkValidate()) {
+                
+                console.log("validated");
+                
+            }
+            
+            console.log("didnt validate");
+            
+        });
+            
+        $('#registerSubmit').click(function() {
+            
+            if ($('#registration').smkValidate()) {
+                
+                console.log("validated");
+                
+            }
+            
+            console.log("didnt validate");
+            User.processRegistration();
+            
+        });
+            
 
         $(document).ready(function(){
             
@@ -808,17 +896,19 @@ endif;
         $(function () {
             
             $.smkAlert({
+                position: 'top-left',
                 text: '<?php if(!empty($USER->info_log)) : 
                     echo $USER->info_log[0]; 
                     elseif(empty($USER->info_log)) :
                     echo "Welcome Guest!";
                     endif;?>',
                 type: 'info'
+                
             });
 
         });
             
-        $('#reload').on('click touchstart', function(){
+        $('#reload').on('click tap', function(){
 
             $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
 
@@ -844,7 +934,7 @@ endif;
 
         });
             
-        $("li[id^='settings.phpx']").on('click touchstart', function(){
+        $("li[id^='settings.phpx']").on('click tap', function(){
 
             $("img[id^='settings-icon']").attr("class", "fa-spin");
 
@@ -856,7 +946,7 @@ endif;
 
         });
 
-        $('#logoutSubmit').on('click touchstart', function(){
+        $('#logoutSubmit').on('click tap', function(){
 
             $( "#logout" ).submit();
 
@@ -868,7 +958,7 @@ endif;
 
         });
             
-        $("li[class^='tab-item']").on('click touchstart', function(){
+        $("li[class^='tab-item']").on('click vclick', function(){
                 
             var thisidfull = $(this).attr("id");
 

+ 6 - 4
js/menu/gnmenu.js

@@ -53,6 +53,7 @@
 					self._closeMenu(); 
 					document.addEventListener( self.eventtype, self.bodyClickFn ); 
 				} ); */
+
 			}
 			this.trigger.addEventListener( this.eventtype, function( ev ) {
 				ev.stopPropagation();
@@ -68,16 +69,17 @@
 			} );
 			this.menu.addEventListener( this.eventtype, function(ev) { ev.stopPropagation(); } );
             
-            $("li[class^='tab-item']").on('touchstart', function(){
-                
+            $("li[class^='tab-item']").on('click vclick', function(){
+
+
                 if( self.isMenuOpen ) {
 					self._closeMenu();
 					document.removeEventListener( self.eventtype, self.bodyClickFn );
 				}
-				else {
+				/*else {
 					self._openMenu();
 					document.addEventListener( self.eventtype, self.bodyClickFn );
-				}
+				}*/
    
             });
             

+ 2 - 2
js/user.js

@@ -41,7 +41,7 @@ User = {
 		var username = input.value;
 		if(username.trim()=="") { return this.markInvalid(input, "You forgot your user name."); }
 		if(username.indexOf("'")>-1) { return this.markInvalid(input, "Apostrophes are not allowed in user names."); }
-		if(username.length<4) { return this.markInvalid(input, "Sorry, user names must be more than 3 letters."); }
+		if(username.length<3) { return this.markInvalid(input, "Sorry, user names must be more than 2 letters."); }
 		return this.markValid(input);
 	},
 
@@ -91,7 +91,7 @@ User = {
 		// that just confuses your users. If you want to enforce strong passwords,
 		// calculate how easy it is to guess the password, and report how quickly
 		// you can figure out their password so that they pick a better one.
-		if(password.length<8) { return this.markInvalid(input, "Your password is too easy to guess, please pick something longer. Use an entire sentence. if you like."); }
+		if(password.length<4) { return this.markInvalid(input, "Your password is too easy to guess, please pick something longer. Use an entire sentence. if you like."); }
 		return this.markValid(input);
 	},
 

+ 49 - 31
settings.php

@@ -78,7 +78,6 @@ if($hasOptions == "No") :
 
 endif;
 
-
 if($tabSetup == "No") :
 
     $result = $file_db->query('SELECT * FROM tabs');
@@ -91,6 +90,25 @@ if($hasOptions == "Yes") :
     
 endif;
 
+if($hasOptions == "Yes") : 
+                                    
+    foreach($resulto as $row) : 
+
+        $title = $row['title'];
+        $topbartext = $row['topbartext'];
+        $topbar = $row['topbar'];
+        $bottombar = $row['bottombar'];
+        $sidebar = $row['sidebar'];
+        $hoverbg = $row['hoverbg'];
+        $activetabBG = $row['activetabBG'];
+        $activetabicon = $row['activetabicon'];
+        $activetabtext = $row['activetabtext'];
+        $inactiveicon = $row['inactiveicon'];
+        $inactivetext = $row['inactivetext'];
+
+    endforeach;
+
+endif;
 
 $action = "";
                 
@@ -260,6 +278,8 @@ if($action == "addTabz") :
         $stmt->execute();
         
     endforeach;
+
+    //echo "<script>window.onload = function() {if(!window.location.hash) {window.location = window.location + '#loaded';window.location.reload();}}</script>";
     
 endif;
 
@@ -358,7 +378,7 @@ endif;
         
     </head>
 
-    <body style="padding: 0;">
+    <body style="padding: 0; background: #273238;">
         
         <style>
         
@@ -383,7 +403,7 @@ endif;
                   
                         <div class="tabbable tabs-with-bg" id="eighth-tabs">
                     
-                            <ul class="nav nav-tabs">
+                            <ul class="nav nav-tabs" style="background: #76828e">
                       
                                 <li class="active">
                         
@@ -705,7 +725,7 @@ endif;
                                                     
                                                     <div class="form-group">
                                                         
-                                                        <select class="btn waves btn-default btn-lg waves-effect waves-float" name="username">
+                                                        <select class="form-control" name="username">
                                                             
                                                             <?php foreach($getUsers as $row) : ?>
 
@@ -735,6 +755,13 @@ endif;
                         
                                     <p id="version"></p>
                                     
+                                    <p id="submitFeedback">
+                                    
+                                        <a href='https://github.com/causefx/Organizr/issues/new' target='_blank' type='button' class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span>Submit Issue or Request</a> 
+                                        <a href='https://github.com/causefx/Organizr' target='_blank' type='button' class='btn waves btn-labeled btn-primary btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github'></i></span>View On Github</a> 
+                                    
+                                    </p>
+                                    
                                     <p id="whatsnew"></p>
                                     
                                     <p id="downloadnow"></p>
@@ -768,29 +795,7 @@ endif;
                                 </div>
                                 
                                 <div class="tab-pane small-box  fade in" id="customedit">
-                                    
-                                    <?php if($hasOptions == "Yes") : 
-                                    
-                                        foreach($resulto as $row) : 
-
-                                            $title = $row['title'];
-                                            $topbartext = $row['topbartext'];
-                                            $topbar = $row['topbar'];
-                                            $bottombar = $row['bottombar'];
-                                            $sidebar = $row['sidebar'];
-                                            $hoverbg = $row['hoverbg'];
-                                            $activetabBG = $row['activetabBG'];
-                                            $activetabicon = $row['activetabicon'];
-                                            $activetabtext = $row['activetabtext'];
-                                            $inactiveicon = $row['inactiveicon'];
-                                            $inactivetext = $row['inactivetext'];
-
-                                        endforeach;
-                                    
-                                    endif;
-                                    
-                                    ?>
-                        
+
                                     <form id="add_optionz" method="post">
                                         
                                         <input type="hidden" name="action" value="addOptionz" />
@@ -989,7 +994,16 @@ endif;
         <?php if($action == "addTabz") : ?>
         <script>
 
-            swal("Tabs Saved!", "Apply Changes To Reload The Page!", "success");
+            if(!window.location.hash) {
+                
+                window.location = window.location + '#loaded';
+                window.location.reload();
+                
+            }else{
+                
+               swal("Tabs Saved!", "Apply Changes To Reload The Page!", "success"); 
+                
+            }
             
         </script>
         <?php endif; ?>
@@ -1025,7 +1039,11 @@ endif;
                 if (isConfirm) {
                     swal("Deleted!", "The Database is long gone now.", "success");
 
-                    <?php unlink($dbfile); 
+                    <?php 
+                    
+                    $file_db = null;
+                    
+                    unlink($dbfile); 
                     
                     foreach(glob($userdirpath . '/*') as $file) : 
 
@@ -1250,7 +1268,7 @@ endif;
                 dataType: "json",
                 success: function(github) {
                    
-                    var currentVersion = "0.932";
+                    var currentVersion = "0.95";
                     var githubVersion = github.tag_name;
                     var githubDescription = github.body;
                     var githubName = github.name;
@@ -1270,7 +1288,7 @@ endif;
                         
                         $(infoTabNew).html("<br/><h4><strong>What's New in " + githubVersion + "</strong></h4><strong>Title: </strong>" + githubName + " <br/><strong>Changes: </strong>" + githubDescription);
                         
-                        $(infoTabDownload).html("<br/><a href='https://github.com/causefx/Organizr' target='_blank' type='button' class='btn waves btn-labeled btn-primary btn-lg text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span>View On Github</a> <a href='https://github.com/causefx/Organizr/archive/master.zip' target='_blank' type='button' class='btn waves btn-labeled btn-success btn-lg text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-download'></i></span>Download Organizr v." + githubVersion + "</a>");
+                        $(infoTabDownload).html("<br/><a href='https://github.com/causefx/Organizr/archive/master.zip' target='_blank' type='button' class='btn waves btn-labeled btn-success btn-lg text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-download'></i></span>Download Organizr v." + githubVersion + "</a>");
                     
                     }else if(currentVersion === githubVersion){