sibyperiyar / Easy-HotSpot

Easy HotSpot is a super easy WiFi hotspot user management utility for Mikrotik RouterOS based Router devices. Voucher printing in 6 ready made templates are available. Can be installed in any PHP/MySql enabled servers locally or in Internet web servers. Uses the PHP PEAR2 API Client by boenrobot.
http://hotspot.helloperiyar.com
59 stars 48 forks source link

Error on user creatin during first login #7

Open BrixSat opened 2 years ago

BrixSat commented 2 years ago

During first login Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1364 Field 'email' doesn't have a default value in /var/www/html/Easy-HotSpot/login.php:67 Stack trace: #0 /var/www/html/Easy-HotSpot/login.php(67): PDOStatement->execute() #1 {main} thrown in /var/www/html/Easy-HotSpot/login.php on line 67

BrixSat commented 2 years ago

Solution: arround line 65 if( $count == 0 ) { $password = sha1('admin'); $stmt = $DB_con->prepare("insert into hotspot_users (date_added, firstname, username, password, user_level, status, user_group, created_at, email, lastname,image_path,thumb_path) values(CURDATE(), 'Administrator', :username, :password, :level, 'Active', 1, NOW(),'admin@local.host','admin','','')"); $stmt->execute(array(':username' => 'admin', ':password' => $password, ':level' => 1)); }