Pārlūkot izejas kodu

Minor Fixes

Fixed issue on creating user from settings causing you to login as that
user
Fixed notification pop up side
Fixed title logo size issue on mobile on thick title bar
Added version history to about page
Edited info and error messages
Changed settings background on advanced settings
Added text to update page to tell user they can close whenever they want
Added login image instead of black user image
causefx 9 gadi atpakaļ
vecāks
revīzija
94d6dd81d3
8 mainītis faili ar 107 papildinājumiem un 52 dzēšanām
  1. 8 8
      css/style.css
  2. BIN
      images/login.png
  3. 22 6
      index.php
  4. 1 1
      js/notifications/ns-style-growl.css
  5. 2 1
      js/notifications/ns-style-other.css
  6. 49 12
      settings.php
  7. 1 1
      updatedb.php
  8. 24 23
      user.php

+ 8 - 8
css/style.css

@@ -493,7 +493,7 @@ a.text-info:hover {
 }
 
 .mini-nav .gn-menu-main .navbar-right a {
-    padding: 0 15px 0 0 !important;
+    padding: 0 5px 0 0 !important;
     font-size: 18px;
 }
 
@@ -3156,12 +3156,12 @@ ul.inbox-pagination li {
 }
 
 .cbp_tmtimeline > li .cbp_tmtime span:first-child {
-  font-size: 0.9em;
+  font-size: 1.1em;
   color: #bdd0db;
 }
 
 .cbp_tmtimeline > li .cbp_tmtime span:last-child {
-  font-size: 2.9em;
+  font-size: 2.0em;
   color: #368fe5;
 }
 
@@ -3170,13 +3170,13 @@ ul.inbox-pagination li {
 }
 
 .cbp_tmtimeline > li .cbp_tmlabel {
-  margin: 0 0 15px 25%;
+  margin: 0 0 10px 25%;
   background: #368fe5;
   color: #fff;
-  padding: 2em;
-  font-size: 1.2em;
+  padding: 1em;
+  font-size: 1.1em;
   font-weight: 300;
-  line-height: 1.4;
+  line-height: 1.1;
   position: relative;
   -webkit-border-radius: 3px;
           border-radius: 3px;
@@ -3337,7 +3337,7 @@ ul.inbox-pagination li {
 
 /* Growl-style notifications */
 .ns-attached {
-  left: 30px;
+  right: 30px;
   max-width: 300px;
 }
 

BIN
images/login.png


+ 22 - 6
index.php

@@ -39,7 +39,7 @@ function printArray($arrayName){
     
     foreach ( $arrayName as $item ) :
         
-        echo $item . "<br/>";
+        echo "<small class='text-uppercase'>" . $item . "</small> ";
         
     endforeach;
     
@@ -254,7 +254,8 @@ else :
     if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
 
 endif;
-if(defined('SLIMBAR') && SLIMBAR == '') : define('SLIMBAR', 'true'); endif;
+if(!defined('SLIMBAR')) : define('SLIMBAR', 'false'); endif;
+if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
 
 if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
 
@@ -470,6 +471,19 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             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);
+        }img.titlelogoclass {
+
+            max-width: 250px; 
+            max-height: <?=$slimBar;?>px;
+            
+        }@media only screen and (max-width: 450px) {
+            
+            img.titlelogoclass {
+
+                max-width: 150px; 
+            
+            }
+            
         }
 
         <?php if(SLIMBAR == "true") : ?>
@@ -503,7 +517,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
             
             line-height: 30px !important;
             
-        }.titlelogoclass {
+        }img.titlelogoclass {
             
             vertical-align: inherit;
             
@@ -714,7 +728,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
                     
                         else : 
                     
-                            echo "<img class='titlelogoclass' style='max-width: 250px; max-height:" . $slimBar ."px;' src='" . TITLELOGO . "'>";
+                            echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
                     
                         endif;
                     
@@ -744,9 +758,9 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
                             
                             <a class="show-members">
                                 
-                            <?php endif; endif;?>
+                            <?php endif; endif; if($USER->authenticated) : $showPic = "<img src='https://www.gravatar.com/avatar/$userpic?s=$userSize' class='img-circle'>"; else : $showPic = "<img style='height: " . $userSize . "px'; src='images/login.png'>"; endif;?>
                                 
-                                <i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=<?=$userSize;?>&d=mm" class="img-circle"></i> 
+                                <i class="userpic"><?=$showPic;?></i> 
                                 
                             </a>
                             
@@ -816,6 +830,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
 
                                             <input type="hidden" name="op" value="register"/>
                                             <input type="hidden" name="sha1" value=""/>
+                                            <input type="hidden" name="settings" value="false"/>
 
                                             <div class="form-group">
 
@@ -1213,6 +1228,7 @@ if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56
                                         
                                         <input type="hidden" name="op" value="register"/>
                                         <input type="hidden" name="sha1" value=""/>
+                                        <input type="hidden" name="settings" value="false"/>
 
                                         <div class="form-group">
 

+ 1 - 1
js/notifications/ns-style-growl.css

@@ -1,7 +1,7 @@
 /* Growl-style notifications */
 .ns-growl {
 	top: 30px;
-	left: 30px;
+	right: 30px;
 	max-width: 300px;
 	border-radius: 5px;
 }

+ 2 - 1
js/notifications/ns-style-other.css

@@ -242,7 +242,7 @@
 	width: 250px; 
 	height: 90px;
 	top: 30px;
-	left: 30px;
+	right: 30px;
 	background: #5699bc;
 	font-weight: 700;
 	border-radius: 5px;
@@ -339,6 +339,7 @@
 /* Thumb slider */
 .ns-effect-thumbslider {
 	background: transparent;
+    right: 30px;
 }
 
 .ns-effect-thumbslider .ns-close {

+ 49 - 12
settings.php

@@ -29,7 +29,7 @@ function printArray($arrayName){
     
     foreach ( $arrayName as $item ) :
         
-        echo $item . "<br/>";
+        echo "<small class='text-uppercase'>" . $item . "</small> ";
         
     endforeach;
     
@@ -768,7 +768,7 @@ endif;
                                             <?php
                                             $dirname = "images/";
                                             $images = scandir($dirname);
-                                            $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg");
+                                            $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg", "login.png");
                                             foreach($images as $curimg){
                                                 if(!in_array($curimg, $ignore)) { ?>
 
@@ -985,6 +985,7 @@ endif;
                         								    
                                                     <input type="hidden" name="op" value="register"/>
                                                     <input type="hidden" name="sha1" value=""/>
+                                                    <input type="hidden" name="settings" value="true"/>
 
                                                     <div class="form-group">
 
@@ -1148,7 +1149,7 @@ endif;
                                         
                                         <div class="col-lg-12">
                                           
-                                            <div class="gray-bg content-box big-box box-shadow">
+                                            <div class="big-box">
                                             
                                                 <form class="content-form" name="systemSettings" id="systemSettings" action="" method="POST">
                         								    
@@ -1214,7 +1215,7 @@ endif;
                                                         if($notifyExplode[1] == "thumbslider") : $thumbsliderActive = "selected"; else : $thumbsliderActive = ""; endif;
                                                         
                                                         ?>
-                                                            <select id="notifyValue" style="background-color: #273238 !important;" name="notifyEffect" id="notifyEffect" class="form-control material input-sm" required>
+                                                            <select id="notifyValue" name="notifyEffect" id="notifyEffect" class="form-control material input-sm" required>
 
                                                                 <option value="bar-slidetop" <?=$slidetopActive;?>>Slide From Top</option>
                                                                 <option value="bar-exploader" <?=$exploaderActive;?>>Exploader From Top</option>
@@ -1428,6 +1429,7 @@ endif;
                                         <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><?php echo $language->translate("VIEW_ON_GITHUB");?></a>
                                         <a href='https://gitter.im/Organizrr/Lobby' target='_blank' type='button' class='btn waves btn-labeled btn-dark btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-comments-o'></i></span><?php echo $language->translate("CHAT_WITH_US");?></a>
                                         <button type="button" class="class='btn waves btn-labeled btn-warning btn text-uppercase waves-effect waves-float" data-toggle="modal" data-target=".Help-Me-modal-lg"><span class='btn-label'><i class='fa fa-life-ring'></i></span><?php echo $language->translate("HELP");?></button>
+                                        <button id="deleteToggle" type="button" class="class='btn waves btn-labeled btn-danger btn text-uppercase waves-effect waves-float" ><span class='btn-label'><i class='fa fa-trash'></i></span><?php echo $language->translate("DELETE_DATABASE");?></button>
 
                                         <div class="modal fade Help-Me-modal-lg" tabindex="-1" role="dialog">
                                         
@@ -1677,7 +1679,7 @@ endif;
                                     
                                     <p id="downloadnow"></p>
                                     
-                                    <div class="panel panel-danger">
+                                    <div id="deleteDiv" style="display: none;" class="panel panel-danger">
                                         
                                         <div class="panel-heading">
                                             
@@ -1706,6 +1708,22 @@ endif;
                                         </div>
                                         
                                     </div>
+                                
+                                    <div class="timeline-container">
+                                        
+                                        <div class="row">
+                                            
+                                            <div class="col-lg-12">
+                                                
+                                                <ul class="cbp_tmtimeline" id="versionHistory">
+                                                    
+                                                </ul>
+                                                
+                                            </div>
+                                            
+                                        </div>
+                                        
+                                    </div>
                       
                                 </div>
                                 
@@ -2226,6 +2244,12 @@ endif;
      
             });
             
+            $("#deleteToggle").click(function(){
+
+                $( "#deleteDiv" ).toggle();
+     
+            });
+            
             $(".deleteUser").click(function(){
 
                 var parent_id = $(this).parent().attr('id');
@@ -2527,18 +2551,31 @@ endif;
         	$.ajax({
         				
         		type: "GET",
-                url: "https://api.github.com/repos/causefx/Organizr/releases/latest",
+                url: "https://api.github.com/repos/causefx/Organizr/releases",
                 dataType: "json",
                 success: function(github) {
+                    
+                    var currentVersion = "0.99996";
                    
-                    var currentVersion = "0.99995";
-                    var githubVersion = github.tag_name;
-                    var githubDescription = github.body;
-                    var githubName = github.name;
                     infoTabVersion = $('#about').find('#version');
+                    infoTabVersionHistory = $('#about').find('#versionHistory');
                     infoTabNew = $('#about').find('#whatsnew');
                     infoTabDownload = $('#about').find('#downloadnow');
-        
+                   
+                    $.each(github, function(i,v) {
+                        if(i === 0){ 
+                            
+                            console.log(v.tag_name);
+                            githubVersion = v.tag_name;
+                            githubDescription = v.body;
+                            githubName = v.name;
+                                   
+                        }
+                        
+                        $(infoTabVersionHistory).append('<li><time class="cbp_tmtime" datetime="' + v.published_at + '"><span>' + v.published_at.substring(0,10) + '</span> <span>' + v.tag_name + '</span></time><div class="cbp_tmicon cbp_tmicon-earth animated pulse"></div><div class="cbp_tmlabel"><h2 class="text-uppercase">' + v.name + '</h2><p>' + v.body + '</p></div></li>');
+                        
+                    });
+                            
         			if(currentVersion < githubVersion){
                     
                     	console.log("You Need To Upgrade");
@@ -2566,7 +2603,7 @@ endif;
                     }
 
                     $(infoTabVersion).html("<strong><?php echo $language->translate("INSTALLED_VERSION");?>: </strong>" + currentVersion + " <strong><?php echo $language->translate("CURRENT_VERSION");?>: </strong>" + githubVersion + " <strong><?php echo $language->translate("DATABASE_PATH");?>:  </strong> <?php echo htmlentities(DATABASE_LOCATION);?>");
-                    
+                                        
                 }
                 
             });

+ 1 - 1
updatedb.php

@@ -119,7 +119,7 @@ function checkDatabase($type, $table, $check) {
             (function countdown(remaining) {
                 if(remaining === 0)
                     location.reload(true);
-                document.getElementById('countdown').innerHTML = "<center>Page will refresh in <strong>" + remaining + "</strong> seconds</center>";
+                document.getElementById('countdown').innerHTML = "<center>Page will refresh in <strong>" + remaining + "</strong> seconds [You may close this at anytime]</center>";
                 setTimeout(function(){ countdown(remaining - 1); }, 1000);
             })(10);
         

+ 24 - 23
user.php

@@ -183,7 +183,7 @@
 		// this function rebuilds the database if there is no database to work with yet
 		function rebuild_database($dbfile)
 		{
-			$this->info("rebuilding database as ".$dbfile);
+			$this->info("creating/rebuilding database as ".$dbfile);
 			$this->database->beginTransaction();
 			$create = "CREATE TABLE users (username TEXT UNIQUE, password TEXT, email TEXT UNIQUE, token TEXT, role TEXT, active TEXT, last TEXT);";
 			$this->database->exec($create);
@@ -243,10 +243,10 @@
             $rememberMe = $_POST["rememberMe"];
 			// step 1: someone could have bypassed the javascript validation, so validate again.
 			if(!$this->validate_user_name($username)) {
-				$this->info("log in error: user name did not pass validation");
+				$this->info("<strong>log in error:</strong> user name did not pass validation");
 				return false; }
 			if(preg_match(User::sha1regexp, $sha1)==0) {
-				$this->info("log in error: password did not pass validation");
+				$this->info("<strong>log in error:</strong> password did not pass validation");
 				return false; }
 			// step 2: if validation passed, log the user in
 			if($rememberMe == "true") {
@@ -265,7 +265,7 @@
 			$username = $_POST["username"];
 			// step 1: validate the user name.
 			if(!$this->validate_user_name($username)) {
-				$this->info("log in error: user name did not pass validation");
+				$this->info("<strong>log in error:</strong> user name did not pass validation");
 				return false; }
 			// step 2: if validation passed, log the user out
 			return $this->logout_user($username);
@@ -280,7 +280,7 @@
 			$username = $_POST["username"];
 			// step 1: validate the user name.
 			if(!$this->validate_user_name($username)) {
-				$this->info("unregistration error: user name did not pass validation");
+				$this->info("<strong>unregistration error:</strong> user name did not pass validation");
 				return false; }
 			// step 2: if validation passed, drop the user from the system
 			return $this->unregister_user($username);
@@ -295,18 +295,19 @@
 			$username = $_POST["username"];
 			$email = $_POST["email"];
 			$sha1 = $_POST["sha1"];
+			$settings = $_POST["settings"];
 			// step 1: someone could have bypassed the javascript validation, so validate again.
 			if(!$this->validate_user_name($username)) {
-				$this->info("registration error: user name did not pass validation");
+				$this->info("<strong>registration error:</strong> user name did not pass validation");
 				return false; }
 			if(preg_match(User::emailregexp, $email)==0) {
-				$this->info("registration error: email address did not pass validation");
+				$this->info("<strong>registration error:</strong> email address did not pass validation");
 				return false; }
 			if(preg_match(User::sha1regexp, $sha1)==0) {
-				$this->info("registration error: password did not pass validation");
+				$this->info("<strong>registration error:</strong> password did not pass validation");
 				return false; }
 			// step 2: if validation passed, register user
-			$registered = $this->register_user($username, $email, $sha1, $registration_callback);
+			$registered = $this->register_user($username, $email, $sha1, $registration_callback, $settings);
 			if($registered && User::use_mail)
 			{
 				// send email notification
@@ -350,10 +351,10 @@ EOT;
             @$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");
+				$this->info("<strong>registration error:</strong> email address did not pass validation");
 				return false; }
 			if($sha1 !="" && preg_match(User::sha1regexp, $sha1)==0) {
-				$this->info("registration error: password did not pass validation");
+				$this->info("<strong>registration error:</strong> password did not pass validation");
 				return false; }
 			// step 2: if validation passed, update the user's information
 			return $this->update_user($username, $email, $sha1, $role);
@@ -555,7 +556,7 @@ EOT;
 		 * is profile information that can be set, but in no way
 		 * needs to be, in the user's profile section
 		 */
-		function register_user($username, $email, $sha1, &$registration_callback = false)
+		function register_user($username, $email, $sha1, &$registration_callback = false, $settings)
 		{
 			$dbpassword = $this->token_hash_password($username, $sha1, "");
 			if($dbpassword==$sha1) die("password hashing is not implemented.");
@@ -577,9 +578,9 @@ EOT;
 				$usernames = array();
 				foreach($this->database->query($query) as $data) { $usernames[] = $this->homogenise_username($data["username"]); }
 				if(in_array($this->homogenise_username($username), $usernames)) {
-					$this->info("user account for $username not created.");
-					$this->error = "this user name is not allowed, because it is too similar to other user names.";
-                    $this->error("this user name is not allowed, because it is too similar to other user names.");
+					//$this->info("user account for $username not created.");
+					$this->error = "<strong>$username</strong> is not allowed, because it is too similar to other user names.";
+                    $this->error("<strong>$username</strong> is not allowed, because it is too similar to other user names.");
 					return false; }}
 
 			// Is email address already in use? (see notes on safe reporting)
@@ -601,10 +602,10 @@ EOT;
 				// make the user's data directory
 				$dir = USER_HOME . $username;
 				if(!mkdir($dir, 0760, true)) { $this->error("could not make user directory $dir"); return false; }
-				$this->info("created user directory $dir");
+				//$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);
+                if($settings !== "true") { $this->login_user($username, $sha1, true); }
 				return true; }
 			$this->error = "unknown database error occured.";
             $this->error("unknown database error occured.");
@@ -705,7 +706,7 @@ EOT;
 				$dbpassword = $this->token_hash_password($username, $sha1, $this->get_user_token($username));
 				$update = "UPDATE users SET password = '$dbpassword' WHERE username = '$username'";
 				$this->database->exec($update); }
-			$this->info("update the information for $username");
+			$this->info("updated the information for <strong>$username</strong>");
 		}
 
 		/**
@@ -716,7 +717,7 @@ EOT;
 			$update = "UPDATE users SET active = 'false' WHERE username = '$username'";
 			$this->database->exec($update);
 			$this->resetSession();
-			$this->info("logged $username out");
+			$this->info("Buh-Bye <strong>$username</strong>!");
             unset($_COOKIE['Organizr']);
             setcookie('Organizr', '', time() - 3600, '/');
             unset($_COOKIE['OrganizrU']);
@@ -733,11 +734,11 @@ EOT;
 		{
 			$delete = "DELETE FROM users WHERE username = '$username'";
 			$this->database->exec($delete);
-			$this->info("removed $username from the Organizr");
+			$this->info("<strong>$username</strong> has been kicked out of Organizr");
 			//$this->resetSession();
             $dir = USER_HOME . $username;
             if(!rmdir($dir)) { $this->error("could not delete user directory $dir"); }
-            $this->info("deleted user directory $dir");
+            $this->info("and we deleted user directory $dir");
 			return true;
 		}
 
@@ -797,7 +798,7 @@ EOT;
 			$update = "UPDATE users SET password = '$newpassword' WHERE username = '$username'";
 			$this->database->exec($update);
 			if($noMsg == "false"){
-                $this->info("updated token and password for $username");   
+                $this->info("token and password updated for <strong>$username</strong>");   
             }
 
 			return $token;
@@ -836,7 +837,7 @@ EOT;
 				//$this->info("$username is active");
 				return true; }
 
-			$this->error("$username is not active");
+			$this->error("<strong>$username</strong> is not active");
 			$this->resetSession();
 			return false;
 		}