Forráskód Böngészése

Add passcode in addUser

Si Thu Mg Mg 5 éve
szülő
commit
a05cdaf016
7 módosított fájl, 39 hozzáadás és 6 törlés
  1. 4 3
      api/v1/Users/addUser.php
  2. BIN
      db/f.db
  3. 12 0
      header.php
  4. 3 0
      home.php
  5. 2 2
      index.php
  6. 17 0
      ini/logs/log.txt
  7. 1 1
      pid

+ 4 - 3
api/v1/Users/addUser.php

@@ -1,7 +1,7 @@
 <?php 
   require "connectionDb.php";
 
-  if (isset($_POST['edit']) && $_POST['role']!='super' && $_POST['username']!='super' && $_POST['email']!='super' ) {
+  if (isset($_POST['add']) && $_POST['role']!='super' && $_POST['username']!='super' && $_POST['email']!='super' ) {
     
 
      $role = $_POST['role'];
@@ -9,11 +9,12 @@
      $username = $_POST['username'];
      $email = $_POST['email'];
      $password = $_POST['password'];
+     $passcode = generate_password();
      $pumplist = $_POST['pumplist'];
      $pumpliststr = implode(",", $pumplist);
 
      
-     $sql ="INSERT INTO user SET created_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),updated_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'), name='$username', email='$email', password='$password',role='$role',pump_list='$pumpliststr' WHERE id='$id'";
+     $sql ="INSERT INTO user SET created_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'),updated_at=strftime('%Y-%m-%d %H:%M:%f000000+06:30', 'now', 'localtime'), name='$username', email='$email', password='$password',role='$role',pump_list='$pumpliststr',pass_code='$passcode' WHERE id='$id'";
 
     $db->exec($sql);
 
@@ -121,7 +122,7 @@ input[type=checkbox]:checked:after {
  
   <div class="form-group">
       <div class="col-sm-offset-2 col-sm-10"> 
-    <input type="submit" name="edit" value="Submit" class="btn btn-success">
+    <input type="submit" name="add" value="Submit" class="btn btn-success">
     <input type="button" value="Cancel" class="btn btn-danger" onclick="document.getElementById('editVForm').style.display = 'none';">
     </div>
   </div>

BIN
db/f.db


+ 12 - 0
header.php

@@ -12,6 +12,18 @@ function decimalAndNumberFormat3($number){
   $i = number_format(round($number,3));
   return $i;
 }
+
+function generate_password($length = 6){
+$chars =  '0123456789';
+
+$str = '';
+$max = strlen($chars) - 1;
+
+for ($i=0; $i < $length; $i++)
+  $str .= $chars[random_int(0, $max)];
+
+return $str;
+}
 ?>
 <!DOCTYPE html>
 <html lang="en" >

+ 3 - 0
home.php

@@ -0,0 +1,3 @@
+<?php 
+	echo '<CENTER>WELCOME TO ADMIN PAGE</CENTER>';
+ ?>

+ 2 - 2
index.php

@@ -50,7 +50,7 @@
       <!-- /.search form -->
       <!-- sidebar menu: : style can be found in sidebar.less -->
       <ul class="sidebar-menu" data-widget="tree" style="background:#c1cbd0;" id="mainNavMenu">
-        <li class="header">MAIN NAVIGATION</li>
+        <!-- <li class="header">MAIN NAVIGATION</li> -->
         <li class="active treeview" >
           <a href="#" class="active" style="margin-bottom: 20px;">
             <i class="fa fa-calculator " ></i>&nbsp; &nbsp;&nbsp; <span>Operations</span>
@@ -125,7 +125,7 @@
   </style>
 <div class="content-wrapper navbar navbar-static-top">
 	
-	  <iframe  src="shiftTankReport.php" id="loadFrame"></iframe>
+	  <iframe  src="home.php" id="loadFrame"></iframe>
 
 </div>
 

+ 17 - 0
ini/logs/log.txt

@@ -2684,3 +2684,20 @@ Fps after connect: [{1 2  86  [] false } {2 2  82  [] false } {3 2  82  [] false
 products: map[1:{1 Diesel 000000} 2:{2 P Diesel 000000} 3:{3 92 RON 000000} 4:{4 95 RON 000000} 5:{5 MS 000000} 6:{6 97 RON 000000}]
 tanks: map[1:{1 1 1} 2:{2 2 2} 3:{3 3 3} 4:{4 4 4} 5:{5 5 5} 7:{7 6 7}]
 Fps after connect: [{1 2  86  [] false } {2 2  82  [] false } {3 2  82  [] false } {4 2  82  [] false } {5 2  82  [] false } {6 2  82  [] false } {7 2  86  [] false } {8 2  82  [] false }]
+---------------------------------------------------
+Forward Station System (FSS) - v0.1.19
+===============
+Ini File Directory ini/
+Data Directory : ./db/
+dbmigration:true
+dblogmode:false
+Static File Location : ./static/
+Static POS Location : ./static-pos/
+Pos Binary Location : ./PosBinary/
+Log Level : ERROR
+DOMS IP Address : 192.168.1.100
+Printer : usb:/dev/usb/lp1
+Forward Station System (FSS) Server started endpoints at : 9999
+products: map[1:{1 Diesel 000000} 2:{2 P Diesel 000000} 3:{3 92 RON 000000} 4:{4 95 RON 000000} 5:{5 MS 000000} 6:{6 97 RON 000000}]
+tanks: map[1:{1 1 1} 2:{2 2 2} 3:{3 3 3} 4:{4 4 4} 5:{5 5 5} 7:{7 6 7}]
+Fps after connect: [{1 1  4  [] false } {2 1  0  [] false } {3 1  0  [] false } {4 1  0  [] false } {5 1  0  [] false } {6 1  0  [] false } {7 1  4  [] false } {8 1  0  [] false }]

+ 1 - 1
pid

@@ -1 +1 @@
-4234
+8047