Explorar o código

Add logging to update function
Added autofocus to lock screen
edited backup functions

causefx %!s(int64=7) %!d(string=hai) anos
pai
achega
c30c46d25b

+ 4 - 0
api/functions/api-functions.php

@@ -204,7 +204,9 @@ function updateDB($path, $filename, $oldVerNum = false)
 			}
 		}
 		$connect->disconnect();
+		writeLog('success', 'Update Function -  Cached Old Database', 'Database');
 	} catch (Dibi\Exception $e) {
+		writeLog('error', 'Update Function -  Cache Error [' . $e . ']', 'Database');
 		return $e;
 	}
 	// Remove Current Database
@@ -222,6 +224,7 @@ function updateDB($path, $filename, $oldVerNum = false)
 		]);
 		// Restore Items
 		if ($success) {
+			writeLog('success', 'Update Function -  Created New Database', 'Database');
 			foreach ($cache as $table => $tableData) {
 				if ($tableData) {
 					$queryBase = 'INSERT INTO ' . $table . ' (`' . implode('`,`', array_keys(current($tableData))) . '`) values ';
@@ -236,6 +239,7 @@ function updateDB($path, $filename, $oldVerNum = false)
 				}
 			}
 		}
+		writeLog('success', 'Update Function -  Migrated Old Info to new Database', 'Database');
 		return true;
 	} catch (Dibi\Exception $e) {
 		writeLog('error', 'Update Function -  Error [' . $e . ']', 'Database');

+ 9 - 1
api/functions/backup-functions.php

@@ -11,10 +11,18 @@ function fileArray($files)
 	}
 }
 
-function backupDB()
+function backupDB($type = 'config')
 {
 	$directory = $GLOBALS['dbLocation'] . 'backups' . DIRECTORY_SEPARATOR;
 	@mkdir($directory, 0770, true);
+	switch ($type) {
+		case 'config':
+			break;
+		case 'full':
+			break;
+		default:
+		
+	}
 	$orgFiles = array(
 		'orgLog' => $GLOBALS['organizrLog'],
 		'loginLog' => $GLOBALS['organizrLoginLog'],

+ 1 - 1
api/pages/lockscreen.php

@@ -16,7 +16,7 @@ if (file_exists('config' . DIRECTORY_SEPARATOR . 'config.php')) {
         </div>
         <div class="form-group ">
           <div class="col-xs-12">
-            <input id="unlockPassword" name="password" class="form-control" type="password" required="" placeholder="password" lang="en">
+            <input id="unlockPassword" name="password" class="form-control" type="password" required="" placeholder="password" lang="en" autofocus>
           </div>
         </div>
         <div class="form-group text-center">