├── favicon.ico ├── images ├── bg.jpg ├── error.png ├── logo.png ├── shot1.png ├── shot2.png ├── shot3.png ├── shot4.png ├── shot5.png ├── shot6.png ├── shotx.png ├── loading.gif ├── progress.gif ├── success.png ├── warning.png └── information.png ├── config.php ├── fonts ├── FontAwesome.otf ├── fontawesome-webfont.eot ├── fontawesome-webfont.ttf ├── fontawesome-webfont.woff ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff ├── logout.php ├── ajax_change_syspass.php ├── .gitattributes ├── ajax_get_sysuser.php ├── ajax_del_sysuser.php ├── ajax_rem_user.php ├── dbconfig.php ├── PEAR2 ├── Console │ ├── Color │ │ ├── Exception.php │ │ ├── UnexpectedValueException.php │ │ ├── Flags.php │ │ ├── Fonts.php │ │ ├── Backgrounds.php │ │ └── Styles.php │ └── CommandLine │ │ ├── Action │ │ ├── Version.php │ │ ├── Help.php │ │ ├── StoreString.php │ │ ├── StoreTrue.php │ │ ├── StoreFalse.php │ │ ├── StoreArray.php │ │ ├── StoreFloat.php │ │ ├── StoreInt.php │ │ ├── Counter.php │ │ ├── List.php │ │ ├── Callback.php │ │ └── Password.php │ │ ├── MessageProvider.php │ │ ├── Outputter.php │ │ ├── Renderer.php │ │ ├── Outputter │ │ └── Default.php │ │ ├── Result.php │ │ ├── Command.php │ │ ├── CustomMessageProvider.php │ │ ├── Argument.php │ │ ├── Exception.php │ │ ├── Action.php │ │ ├── Element.php │ │ └── MessageProvider │ │ └── Default.php ├── Cache │ └── SHM │ │ ├── Exception.php │ │ └── InvalidArgumentException.php └── Net │ ├── RouterOS │ ├── Exception.php │ ├── SocketException.php │ ├── DataFlowException.php │ ├── InvalidArgumentException.php │ ├── NotSupportedException.php │ ├── LengthException.php │ └── UnexpectedValueException.php │ └── Transmitter │ ├── Exception.php │ ├── LockException.php │ ├── SocketException.php │ ├── StreamException.php │ ├── TcpServerConnection.php │ └── NetworkStream.php ├── ajax_reset_pass.php ├── index.php ├── css ├── print.css ├── customModal.css └── style.css ├── ajax_add_sysuser.php ├── ajax_edit_sysuser.php ├── ajax_uninitiated.php ├── ajax_del_profile.php ├── ajax_rem_selected.php ├── ajax_expired.php ├── logme.php ├── database.php ├── ajax_get_profiles.php ├── info.php ├── backup.php ├── modal_delete_guest.php ├── settings.php ├── db_backup_20_09_2016_14_11_47.sql ├── modal_get_user.php ├── modal_change_pass.php ├── login.php ├── readme.txt ├── ajax_addusers.php ├── hotsoft.php ├── ajax_adduser.php ├── ajax_add_profile.php └── ajax_edit_profile.php /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/favicon.ico -------------------------------------------------------------------------------- /images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/bg.jpg -------------------------------------------------------------------------------- /images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/error.png -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/logo.png -------------------------------------------------------------------------------- /images/shot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot1.png -------------------------------------------------------------------------------- /images/shot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot2.png -------------------------------------------------------------------------------- /images/shot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot3.png -------------------------------------------------------------------------------- /images/shot4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot4.png -------------------------------------------------------------------------------- /images/shot5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot5.png -------------------------------------------------------------------------------- /images/shot6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shot6.png -------------------------------------------------------------------------------- /images/shotx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/shotx.png -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/loading.gif -------------------------------------------------------------------------------- /images/progress.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/progress.gif -------------------------------------------------------------------------------- /images/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/success.png -------------------------------------------------------------------------------- /images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/warning.png -------------------------------------------------------------------------------- /fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /images/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/images/information.png -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sibyperiyar/Easy-HotSpot/HEAD/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | window.open("backup.php", "_self").close(); top.close(); window.open("backup.php", "_self", ""); window.close();'; 6 | header('location:index.php'); 7 | ?> -------------------------------------------------------------------------------- /ajax_change_syspass.php: -------------------------------------------------------------------------------- 1 | prepare("update hotspot_users set password = :np where user_id = :session_id"); 9 | $stmt->execute(array(':np' => $np, ':session_id' => $_SESSION['id'])); 10 | echo 1; 11 | } 12 | else 13 | { 14 | echo 0; 15 | } 16 | ?> -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /ajax_get_sysuser.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM hotspot_users WHERE user_id =:user_id"); 9 | $stmt->execute(array(':user_id' => $user_id)); 10 | 11 | $row=$stmt->fetch(PDO::FETCH_ASSOC); 12 | echo json_encode($row); 13 | } 14 | // End Getting Sysuser details 15 | ?> -------------------------------------------------------------------------------- /ajax_del_sysuser.php: -------------------------------------------------------------------------------- 1 | prepare("delete from hotspot_users where user_id=:id and user_id != :myself"); 8 | $stmt->execute(array(':id' => $id, ':myself' => $myself)); 9 | echo 1; 10 | } 11 | else 12 | { 13 | echo 0; 14 | } 15 | // End Adding a new System User Details, Returned from modal_add_user.php 16 | ?> -------------------------------------------------------------------------------- /ajax_rem_user.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id,name'); 12 | $printRequest->setQuery(RouterOS\Query::where('name', $guest_name)); 13 | $id = $client->sendSync($printRequest)->getProperty('.id'); 14 | 15 | $removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); 16 | $removeRequest->setArgument('numbers', $id); 17 | $client->sendSync($removeRequest); 18 | ?> -------------------------------------------------------------------------------- /dbconfig.php: -------------------------------------------------------------------------------- 1 | setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 11 | 12 | $dbname = "`".str_replace("`","``",$DB_name)."`"; 13 | $DB_con->query("CREATE DATABASE IF NOT EXISTS $dbname"); 14 | $DB_con->query("use $dbname"); 15 | } 16 | catch(PDOException $e) { 17 | echo "Error: " . $e->getMessage(); 18 | } 19 | 20 | /* Old Version, NOT creating DB if NOT Exist 21 | $DB_con = new PDO("mysql:host={$DB_host};dbname={$DB_name}",$DB_user,$DB_pass); 22 | $DB_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 23 | */ 24 | ?> -------------------------------------------------------------------------------- /PEAR2/Console/Color/Exception.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 12 | * @version 1.0.0 13 | * @link http://pear2.php.net/PEAR2_Console_Color 14 | */ 15 | namespace PEAR2\Console\Color; 16 | 17 | /** 18 | * Exception class for PEAR2_Console_Color. 19 | * 20 | * @category Console 21 | * @package PEAR2_Console_Color 22 | * @author Vasil Rangelov 23 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 24 | * @link http://pear2.php.net/PEAR2_Console_Color 25 | */ 26 | interface Exception 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /ajax_reset_pass.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM hotspot_users WHERE user_id = :user_id"); 9 | $stmt->execute(array(':user_id' => $user_id)); 10 | $count = $stmt->rowCount(); 11 | if ($count == 0){ 12 | echo 1; 13 | } 14 | else 15 | { 16 | $stmt = $DB_con->prepare("update hotspot_users set password=:password where user_id= :user_id"); 17 | $stmt->execute(array(':password' => $password, ':user_id' => $user_id)); 18 | echo 2; 19 | } 20 | } 21 | else 22 | { 23 | echo 0; 24 | } 25 | //End Resetting a System User Password, called from modal_reset_psd.php Modal 26 | ?> -------------------------------------------------------------------------------- /PEAR2/Cache/SHM/Exception.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 0.1.3 16 | * @link http://pear2.php.net/PEAR2_Cache_SHM 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Cache\SHM; 22 | 23 | /** 24 | * Generic exception class of this package. 25 | * 26 | * @category Caching 27 | * @package PEAR2_Cache_SHM 28 | * @author Vasil Rangelov 29 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 30 | * @link http://pear2.php.net/PEAR2_Cache_SHM 31 | */ 32 | interface Exception 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /PEAR2/Cache/SHM/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 0.1.3 16 | * @link http://pear2.php.net/PEAR2_Cache_SHM 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Cache\SHM; 22 | 23 | /** 24 | * Exception thrown when there's something wrong with an argument. 25 | * 26 | * @category Caching 27 | * @package PEAR2_Cache_SHM 28 | * @author Vasil Rangelov 29 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 30 | * @link http://pear2.php.net/PEAR2_Cache_SHM 31 | */ 32 | class InvalidArgumentException extends \InvalidArgumentException 33 | implements Exception 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | = 4))) { 9 | header("location:login.php"); 10 | } 11 | ?> 12 | 13 | 14 | 16 | 17 | 18 | 19 | getMessage(); 29 | include_once('settings.php'); 30 | } 31 | ?> -------------------------------------------------------------------------------- /css/print.css: -------------------------------------------------------------------------------- 1 | .navbar{ 2 | display:none; 3 | } 4 | .modal{ 5 | display:none; 6 | } 7 | .action{ 8 | display:none; 9 | } 10 | h1{ 11 | text-transform:uppercase; 12 | } 13 | .title, img { 14 | display:visible; 15 | } 16 | th{ 17 | text-align:left; 18 | } 19 | td{ 20 | text-align:left; 21 | border-top:1px solid; 22 | padding:2px; 23 | } 24 | .btn{ 25 | display:none; 26 | } 27 | .alert{ 28 | display:none; 29 | } 30 | body{ 31 | font-family:arial; 32 | font-size:13px; 33 | } 34 | .no_print{ 35 | display:none; 36 | } 37 | .printable{ 38 | display:visible; 39 | } 40 | span{ 41 | text-transform:uppercase; 42 | } 43 | /* 44 | .name span{ 45 | display:block; 46 | } 47 | .name span strong{ 48 | margin-left:10px; 49 | } 50 | .add_grade{ 51 | display:none; 52 | } 53 | .act{ 54 | display:none; 55 | } 56 | .logout{ 57 | display:none; 58 | } 59 | #add{ 60 | display:none; 61 | } 62 | .dataTables_filter{ 63 | display:none; 64 | } 65 | .nav{ 66 | display:none; 67 | } 68 | .dataTables_paginate { 69 | display:none; 70 | } 71 | #example_length{ 72 | display:none; 73 | } 74 | .dataTables_info{ 75 | display:none; 76 | } 77 | */ -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/Exception.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | /** 24 | * Generic exception class of this package. 25 | * 26 | * @category Net 27 | * @package PEAR2_Net_RouterOS 28 | * @author Vasil Rangelov 29 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 30 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 31 | */ 32 | interface Exception 33 | { 34 | } 35 | -------------------------------------------------------------------------------- /PEAR2/Console/Color/UnexpectedValueException.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 12 | * @version 1.0.0 13 | * @link http://pear2.php.net/PEAR2_Console_Color 14 | */ 15 | namespace PEAR2\Console\Color; 16 | 17 | use UnexpectedValueException as U; 18 | 19 | /** 20 | * Exception class for PEAR2_Console_Color. 21 | * 22 | * @category Console 23 | * @package PEAR2_Console_Color 24 | * @author Vasil Rangelov 25 | * @copyright 2011 Ivo Nascimento 26 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 27 | * @link http://pear2.php.net/PEAR2_Console_Color 28 | */ 29 | class UnexpectedValueException extends U implements Exception 30 | { 31 | /** 32 | * Used when an unexpected font value is supplied. 33 | */ 34 | const CODE_FONT = 1; 35 | 36 | /** 37 | * Used when an unexpected background value is supplied. 38 | */ 39 | const CODE_BACKGROUND = 2; 40 | } 41 | -------------------------------------------------------------------------------- /ajax_add_sysuser.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM hotspot_users WHERE username =:username"); 15 | $stmt->execute(array(':username' => $username)); 16 | $count = $stmt->rowCount(); 17 | 18 | if ($count != 0) { 19 | echo 1; 20 | } 21 | else 22 | { 23 | $stmt = $DB_con->prepare("insert into hotspot_users (username, password, firstname, lastname, date_added, user_level, status) 24 | values(:username, :password, :firstname, :lastname, CURDATE(), :user_level, :status)"); 25 | $stmt->execute(array(':username' => $username, ':password' => $password, ':firstname' => $firstname, 26 | ':lastname' => $lastname, ':user_level' => $user_level, ':status' => $status)); 27 | echo 2; 28 | } 29 | } 30 | else { 31 | echo 0; 32 | } 33 | // End Adding a new System User Details, Returned from modal_add_user.php 34 | ?> -------------------------------------------------------------------------------- /ajax_edit_sysuser.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT * FROM hotspot_users WHERE username = :username AND user_id != :user_id"); 10 | $stmt->execute(array(':username' => $username, ':user_id' => $user_id)); 11 | $count = $stmt->rowCount(); 12 | 13 | if ($count != 0) { 14 | echo 1; 15 | } 16 | else 17 | { 18 | $firstname=$_GET['firstname']; 19 | $lastname=$_GET['lastname']; 20 | $user_level=$_GET['user_level']; 21 | $status=$_GET['status']; 22 | 23 | $stmt = $DB_con->prepare("update hotspot_users set username=:username, firstname = :firstname , lastname = :lastname, 24 | user_level = :user_level, status = :status where user_id= :user_id"); 25 | $stmt->execute(array(':username' => $username, ':firstname' => $firstname, ':lastname' => $lastname, 26 | ':user_level' => $user_level, ':user_id' => $user_id, ':status' => $status)); 27 | echo 2; 28 | } 29 | } 30 | else 31 | { 32 | echo 0; 33 | } 34 | // End Adding a new System User Details, Returned from modal_add_user.php 35 | ?> -------------------------------------------------------------------------------- /ajax_uninitiated.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id,limit-uptime,uptime,name'); 11 | //$printRequest->setQuery(RouterOS\Query::where('name', 'default-trial', RouterOS\Query::OP_EQ) ->not()); 12 | $printRequest->setQuery(RouterOS\Query::where('.id', '*0', RouterOS\Query::OP_EQ) ->not()); 13 | 14 | $idList = ''; 15 | foreach ($client->sendSync($printRequest)->getAllOfType(RouterOS\Response::TYPE_DATA) as $item) { 16 | if ($item->getProperty('uptime') == 0) { 17 | $idList .= ',' . $item->getProperty('.id'); 18 | } 19 | } 20 | $idList = substr($idList, 1); 21 | //$idList now contains a comma separated list of all IDs. 22 | 23 | $removeRequest = new RouterOS\Request('/ip hotspot user remove'); 24 | $removeRequest->setArgument('numbers', $idList); 25 | $client->sendSync($removeRequest); 26 | } 27 | //End Removing All Un-initiated Guest User Accounts 28 | ?> 29 | -------------------------------------------------------------------------------- /ajax_del_profile.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id,name'); 17 | $printRequest->setQuery(RouterOS\Query::where('name', $profile_name)); 18 | 19 | $idList = ''; 20 | foreach ($client->sendSync($printRequest)->getAllOfType(RouterOS\Response::TYPE_DATA) as $item) { 21 | $idList .= ',' . $item->getProperty('.id'); 22 | } 23 | $idList = substr($idList, 1); 24 | //$idList now contains a comma separated list of all IDs. 25 | 26 | $removeRequest = new RouterOS\Request('/ip hotspot user profile remove'); 27 | $removeRequest->setArgument('numbers', $idList); 28 | $client->sendSync($removeRequest); 29 | echo 2; //Success 30 | } 31 | else 32 | { 33 | echo 1; //Profile name Empty 34 | } 35 | } 36 | else 37 | { 38 | echo 0; //Not Authorised 39 | } 40 | ?> -------------------------------------------------------------------------------- /ajax_rem_selected.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id,name'); 15 | $removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); 16 | foreach ($guest_list as $guest) { 17 | $i++; 18 | //$printRequest->setArgument('.proplist', '.id,name'); 19 | $printRequest->setQuery(RouterOS\Query::where('name', $guest)); 20 | $id = $client->sendSync($printRequest)->getProperty('.id'); 21 | 22 | //$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); 23 | $removeRequest->setArgument('numbers', $id); 24 | $client->sendSync($removeRequest); 25 | } 26 | echo $i; 27 | } 28 | else 29 | { 30 | echo -1; 31 | } 32 | } 33 | else 34 | { 35 | echo 0; 36 | } 37 | //$id = $client->sendSync(new Request('/ip/hotspot/user/profile/print .proplist=.id', null, Query::where('name', $profile_name)))->getArgument('.id'); 38 | ?> -------------------------------------------------------------------------------- /ajax_expired.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id,limit-uptime,uptime,name'); 12 | //$printRequest->setQuery(RouterOS\Query::where('name', 'admin', RouterOS\Query::OP_EQ) ->not()); 13 | $printRequest->setQuery(RouterOS\Query::where('.id', '*0', RouterOS\Query::OP_EQ) ->not()); 14 | 15 | $idList = ''; 16 | foreach ($client->sendSync($printRequest)->getAllOfType(RouterOS\Response::TYPE_DATA) as $item) { 17 | if (!empty($item->getProperty('limit-uptime'))) { 18 | if (!($item->getProperty('uptime') < $item->getProperty('limit-uptime'))) { 19 | $idList .= ',' . $item->getProperty('.id'); 20 | } 21 | } 22 | } 23 | $idList = substr($idList, 1); 24 | //$idList now contains a comma separated list of all IDs. 25 | 26 | $removeRequest = new RouterOS\Request('/ip hotspot user remove'); 27 | $removeRequest->setArgument('numbers', $idList); 28 | $client->sendSync($removeRequest); 29 | } 30 | //End Removing All Validity Expired Guest User Accounts 31 | ?> 32 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/SocketException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | /** 24 | * Base of this class. 25 | */ 26 | use RuntimeException; 27 | 28 | /** 29 | * Exception thrown when something goes wrong with the connection. 30 | * 31 | * @category Net 32 | * @package PEAR2_Net_RouterOS 33 | * @author Vasil Rangelov 34 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 35 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 36 | */ 37 | class SocketException extends RuntimeException implements Exception 38 | { 39 | const CODE_SERVICE_INCOMPATIBLE = 10200; 40 | const CODE_CONNECTION_FAIL = 100; 41 | const CODE_QUERY_SEND_FAIL = 30600; 42 | const CODE_REQUEST_SEND_FAIL = 40900; 43 | const CODE_NO_DATA = 50000; 44 | } 45 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/DataFlowException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | /** 24 | * Base of this class. 25 | */ 26 | use RuntimeException; 27 | 28 | /** 29 | * Exception thrown when the request/response cycle goes an unexpected way. 30 | * 31 | * @category Net 32 | * @package PEAR2_Net_RouterOS 33 | * @author Vasil Rangelov 34 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 35 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 36 | */ 37 | class DataFlowException extends RuntimeException implements Exception 38 | { 39 | const CODE_INVALID_CREDENTIALS = 10000; 40 | const CODE_TAG_REQUIRED = 10500; 41 | const CODE_TAG_UNIQUE = 10501; 42 | const CODE_UNKNOWN_REQUEST = 10900; 43 | const CODE_CANCEL_FAIL = 11200; 44 | } 45 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | use InvalidArgumentException as I; 24 | 25 | /** 26 | * Exception thrown when there's something wrong with message arguments. 27 | * 28 | * @category Net 29 | * @package PEAR2_Net_RouterOS 30 | * @author Vasil Rangelov 31 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 32 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 33 | */ 34 | class InvalidArgumentException extends I implements Exception 35 | { 36 | const CODE_SEEKABLE_REQUIRED = 1100; 37 | const CODE_NAME_INVALID = 20100; 38 | const CODE_ABSOLUTE_REQUIRED = 40200; 39 | const CODE_CMD_UNRESOLVABLE = 40201; 40 | const CODE_CMD_INVALID = 40202; 41 | const CODE_NAME_UNPARSABLE = 41000; 42 | const CODE_VALUE_UNPARSABLE = 41001; 43 | } 44 | -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/Exception.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | /** 26 | * Generic exception class of this package. 27 | * 28 | * @category Net 29 | * @package PEAR2_Net_Transmitter 30 | * @author Vasil Rangelov 31 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 32 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 33 | */ 34 | interface Exception 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/LockException.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | /** 26 | * Exception thrown when something goes wrong when dealing with locks. 27 | * 28 | * @category Net 29 | * @package PEAR2_Net_Transmitter 30 | * @author Vasil Rangelov 31 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 32 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 33 | */ 34 | class LockException extends \RuntimeException implements Exception 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/Version.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the Version action, a special action that displays the 31 | * version string of the program. 32 | * 33 | * @category Console 34 | * @package PEAR2\Console\CommandLine 35 | * @author David JEAN LOUIS 36 | * @copyright 2007-2009 David JEAN LOUIS 37 | * @license http://opensource.org/licenses/mit-license.php MIT License 38 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 39 | * @since Class available since release 0.1.0 40 | */ 41 | class Version extends CommandLine\Action 42 | { 43 | // execute() {{{ 44 | 45 | /** 46 | * Executes the action with the value entered by the user. 47 | * 48 | * @param mixed $value The option value 49 | * @param array $params An array of optional parameters 50 | * 51 | * @return string 52 | */ 53 | public function execute($value = false, $params = array()) 54 | { 55 | return $this->parser->displayVersion(); 56 | } 57 | // }}} 58 | } 59 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/Help.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the Help action, a special action that displays the 31 | * help message, telling the user how to use the program. 32 | * 33 | * @category Console 34 | * @package PEAR2\Console\CommandLine 35 | * @author David JEAN LOUIS 36 | * @copyright 2007-2009 David JEAN LOUIS 37 | * @license http://opensource.org/licenses/mit-license.php MIT License 38 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 39 | * @since Class available since release 0.1.0 40 | */ 41 | class Help extends CommandLine\Action 42 | { 43 | // execute() {{{ 44 | 45 | /** 46 | * Executes the action with the value entered by the user. 47 | * 48 | * @param mixed $value The option value 49 | * @param array $params An optional array of parameters 50 | * 51 | * @return string 52 | */ 53 | public function execute($value = false, $params = array()) 54 | { 55 | return $this->parser->displayUsage(); 56 | } 57 | // }}} 58 | } 59 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/MessageProvider.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Message providers common interface, all message providers must implement 29 | * this interface. 30 | * 31 | * @category Console 32 | * @package PEAR2\Console\CommandLine 33 | * @author David JEAN LOUIS 34 | * @copyright 2007-2009 David JEAN LOUIS 35 | * @license http://opensource.org/licenses/mit-license.php MIT License 36 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 37 | * @since Class available since release 0.1.0 38 | */ 39 | interface MessageProvider 40 | { 41 | // get() {{{ 42 | 43 | /** 44 | * Retrieves the given string identifier corresponding message. 45 | * For a list of identifiers please see the provided default message 46 | * provider. 47 | * 48 | * @param string $code The string identifier of the message 49 | * @param array $vars An array of template variables 50 | * 51 | * @return string 52 | * @see PEAR2\Console\CommandLine_MessageProvider_Default 53 | */ 54 | public function get($code, $vars=array()); 55 | 56 | // }}} 57 | } 58 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Outputter.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Outputters common interface, all outputters must implement this interface. 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | interface Outputter 39 | { 40 | // stdout() {{{ 41 | 42 | /** 43 | * Processes the output for a message that should be displayed on STDOUT. 44 | * 45 | * @param string $msg The message to output 46 | * 47 | * @return void 48 | */ 49 | public function stdout($msg); 50 | 51 | // }}} 52 | // stderr() {{{ 53 | 54 | /** 55 | * Processes the output for a message that should be displayed on STDERR. 56 | * 57 | * @param string $msg The message to output 58 | * 59 | * @return void 60 | */ 61 | public function stderr($msg); 62 | 63 | // }}} 64 | } 65 | -------------------------------------------------------------------------------- /logme.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | session_start(); 19 | ?> 20 | 21 | 48 | 49 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreString.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreString action. 31 | * 32 | * The execute method store the value of the option entered by the user as a 33 | * string in the result option array entry. 34 | * 35 | * @category Console 36 | * @package PEAR2\Console\CommandLine 37 | * @author David JEAN LOUIS 38 | * @copyright 2007-2009 David JEAN LOUIS 39 | * @license http://opensource.org/licenses/mit-license.php MIT License 40 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 41 | * @since Class available since release 0.1.0 42 | */ 43 | class StoreString extends CommandLine\Action 44 | { 45 | // execute() {{{ 46 | 47 | /** 48 | * Executes the action with the value entered by the user. 49 | * 50 | * @param mixed $value The option value 51 | * @param array $params An array of optional parameters 52 | * 53 | * @return string 54 | */ 55 | public function execute($value = false, $params = array()) 56 | { 57 | $this->setResult((string)$value); 58 | } 59 | // }}} 60 | } 61 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreTrue.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreTrue action. 31 | * 32 | * The execute method store the boolean 'true' in the corrsponding result 33 | * option array entry (the value is false if the option is not present in the 34 | * command line entered by the user). 35 | * 36 | * @category Console 37 | * @package PEAR2\Console\CommandLine 38 | * @author David JEAN LOUIS 39 | * @copyright 2007-2009 David JEAN LOUIS 40 | * @license http://opensource.org/licenses/mit-license.php MIT License 41 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 42 | * @since Class available since release 0.1.0 43 | */ 44 | class StoreTrue extends CommandLine\Action 45 | { 46 | // execute() {{{ 47 | 48 | /** 49 | * Executes the action with the value entered by the user. 50 | * 51 | * @param mixed $value The option value 52 | * @param array $params An array of optional parameters 53 | * 54 | * @return string 55 | */ 56 | public function execute($value = false, $params = array()) 57 | { 58 | $this->setResult(true); 59 | } 60 | // }}} 61 | } 62 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreFalse.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreFalse action. 31 | * 32 | * The execute method store the boolean 'false' in the corrsponding result 33 | * option array entry (the value is true if the option is not present in the 34 | * command line entered by the user). 35 | * 36 | * @category Console 37 | * @package PEAR2\Console\CommandLine 38 | * @author David JEAN LOUIS 39 | * @copyright 2007-2009 David JEAN LOUIS 40 | * @license http://opensource.org/licenses/mit-license.php MIT License 41 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 42 | * @since Class available since release 0.1.0 43 | */ 44 | class StoreFalse extends CommandLine\Action 45 | { 46 | // execute() {{{ 47 | 48 | /** 49 | * Executes the action with the value entered by the user. 50 | * 51 | * @param mixed $value The option value 52 | * @param array $params An array of optional parameters 53 | * 54 | * @return string 55 | */ 56 | public function execute($value = false, $params = array()) 57 | { 58 | $this->setResult(false); 59 | } 60 | 61 | // }}} 62 | } 63 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Renderer.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Renderers common interface, all renderers must implement this interface. 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | interface Renderer 39 | { 40 | // usage() {{{ 41 | 42 | /** 43 | * Returns the full usage message. 44 | * 45 | * @return string The usage message 46 | */ 47 | public function usage(); 48 | 49 | // }}} 50 | // error() {{{ 51 | 52 | /** 53 | * Returns a formatted error message. 54 | * 55 | * @param string $error The error message to format 56 | * 57 | * @return string The error string 58 | */ 59 | public function error($error); 60 | 61 | // }}} 62 | // version() {{{ 63 | 64 | /** 65 | * Returns the program version string. 66 | * 67 | * @return string The version string 68 | */ 69 | public function version(); 70 | 71 | // }}} 72 | } 73 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Outputter/Default.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * PEAR2\Console\CommandLine default Outputter. 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | class Outputter_Default implements Outputter 39 | { 40 | // stdout() {{{ 41 | 42 | /** 43 | * Writes the message $msg to STDOUT. 44 | * 45 | * @param string $msg The message to output 46 | * 47 | * @return void 48 | */ 49 | public function stdout($msg) 50 | { 51 | if (defined('STDOUT')) { 52 | fwrite(STDOUT, $msg); 53 | } else { 54 | echo $msg; 55 | } 56 | } 57 | 58 | // }}} 59 | // stderr() {{{ 60 | 61 | /** 62 | * Writes the message $msg to STDERR. 63 | * 64 | * @param string $msg The message to output 65 | * 66 | * @return void 67 | */ 68 | public function stderr($msg) 69 | { 70 | if (defined('STDERR')) { 71 | fwrite(STDERR, $msg); 72 | } else { 73 | echo $msg; 74 | } 75 | } 76 | 77 | // }}} 78 | } 79 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Result.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * A lightweight class to store the result of the command line parsing. 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | class Result 39 | { 40 | // Public properties {{{ 41 | 42 | /** 43 | * The result options associative array. 44 | * Key is the name of the option and value its value. 45 | * 46 | * @var array $options Result options array 47 | */ 48 | public $options = array(); 49 | 50 | /** 51 | * The result arguments array. 52 | * 53 | * @var array $args Result arguments array 54 | */ 55 | public $args = array(); 56 | 57 | /** 58 | * Name of the command invoked by the user, false if no command invoked. 59 | * 60 | * @var string $command_name Result command name 61 | */ 62 | public $command_name = false; 63 | 64 | /** 65 | * A result instance for the subcommand. 66 | * 67 | * @var static $command Result instance for the subcommand 68 | */ 69 | public $command = false; 70 | 71 | // }}} 72 | } 73 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Command.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Class that represent a command with option and arguments. 29 | * 30 | * This class exist just to clarify the interface but at the moment it is 31 | * strictly identical to PEAR2\Console\CommandLine class, it could change in the 32 | * future though. 33 | * 34 | * @category Console 35 | * @package PEAR2\Console\CommandLine 36 | * @author David JEAN LOUIS 37 | * @copyright 2007-2009 David JEAN LOUIS 38 | * @license http://opensource.org/licenses/mit-license.php MIT License 39 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 40 | * @since Class available since release 0.1.0 41 | */ 42 | class Command extends \PEAR2\Console\CommandLine 43 | { 44 | // Public properties {{{ 45 | 46 | /** 47 | * An array of aliases for the subcommand. 48 | * 49 | * @var array $aliases Aliases for the subcommand. 50 | */ 51 | public $aliases = array(); 52 | 53 | // }}} 54 | // __construct() {{{ 55 | 56 | /** 57 | * Constructor. 58 | * 59 | * @param array $params An optional array of parameters 60 | * 61 | * @return void 62 | */ 63 | public function __construct($params = array()) 64 | { 65 | if (isset($params['aliases'])) { 66 | $this->aliases = $params['aliases']; 67 | } 68 | parent::__construct($params); 69 | } 70 | 71 | // }}} 72 | } 73 | -------------------------------------------------------------------------------- /database.php: -------------------------------------------------------------------------------- 1 | prepare("SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO'"); 3 | $stmt->execute(array()); 4 | 5 | $stmt = $DB_con->prepare("SET time_zone = '+05:30'"); 6 | $stmt->execute(array()); 7 | 8 | $stmt = $DB_con->prepare("CREATE TABLE IF NOT EXISTS `hotspot_users` ( 9 | `user_id` int(11) NOT NULL, 10 | `email` varchar(200) NOT NULL, 11 | `date_added` date NOT NULL, 12 | `firstname` varchar(30) NOT NULL, 13 | `lastname` varchar(30) NOT NULL, 14 | `password` varchar(60) NOT NULL, 15 | `created_at` datetime NOT NULL, 16 | `username` varchar(30) NOT NULL, 17 | `user_level` int(11) NOT NULL DEFAULT '3', 18 | `user_group` int(1) NOT NULL, 19 | `image_path` varchar(50) NOT NULL, 20 | `thumb_path` varchar(50) NOT NULL, 21 | `status` varchar(20) NOT NULL 22 | ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8"); 23 | $stmt->execute(array()); 24 | 25 | $stmt = $DB_con->prepare("ALTER TABLE `hotspot_users` 26 | ADD PRIMARY KEY (`user_id`), 27 | ADD KEY `username` (`username`)"); 28 | $stmt->execute(array()); 29 | 30 | $stmt = $DB_con->prepare("ALTER TABLE `hotspot_users` 31 | MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1"); 32 | $stmt->execute(array()); 33 | 34 | $stmt = $DB_con->prepare("CREATE TABLE IF NOT EXISTS `hotspot_vouchers` ( 35 | `id` int(11) NOT NULL, 36 | `created_on` datetime DEFAULT NULL, 37 | `created_by` varchar(30) DEFAULT NULL, 38 | `creator` int(3) DEFAULT NULL, 39 | `user_name` varchar(30) DEFAULT NULL, 40 | `password` varchar(30) DEFAULT NULL, 41 | `printed_times` int(3) DEFAULT NULL, 42 | `printed_last` varchar(30) DEFAULT NULL, 43 | `status` varchar(10) DEFAULT NULL, 44 | `group_of` int(4) DEFAULT NULL, 45 | `booking_id` int(11) DEFAULT NULL, 46 | `limit_uptime` varchar(30) DEFAULT NULL, 47 | `limit_bytes` varchar(30) DEFAULT NULL, 48 | `profile` varchar(30) DEFAULT NULL, 49 | `uid` VARCHAR(30) NOT NULL 50 | ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8"); 51 | $stmt->execute(array()); 52 | 53 | $stmt = $DB_con->prepare("ALTER TABLE `hotspot_vouchers` 54 | ADD PRIMARY KEY (`id`)"); 55 | $stmt->execute(array()); 56 | 57 | $stmt = $DB_con->prepare("ALTER TABLE `hotspot_vouchers` 58 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT"); 59 | $stmt->execute(array()); 60 | ?> -------------------------------------------------------------------------------- /ajax_get_profiles.php: -------------------------------------------------------------------------------- 1 | setMenu('/ip hotspot user profile print'); 11 | $profile_name=$_GET['profile_name']; 12 | 13 | $printRequest = new RouterOS\Request('/ip hotspot user profile print'); 14 | $printRequest->setArgument('.proplist', '.id,name,address-pool,rate-limit,session-timeout,shared-users,mac-cookie-timeout,keepalive-timeout,on-login'); 15 | $printRequest->setQuery(RouterOS\Query::where('name', $profile_name)); 16 | 17 | foreach ($client->sendSync($printRequest)->getAllOfType(RouterOS\Response::TYPE_DATA) as $item) { 18 | 19 | $tname = $item->getProperty("name"); 20 | $taddress_pool = $item->getProperty("address-pool"); 21 | $tshared_users = $item->getProperty("shared-users"); 22 | $trate_limit = $item->getProperty("rate-limit"); 23 | $tsession_timeout = $item->getProperty("session-timeout"); 24 | $ton_login = $item->getProperty("on-login"); 25 | $tmac_cookie_timeout = $item->getProperty("mac-cookie-timeout"); 26 | $tkeepalive_timeout = $item->getProperty("keepalive-timeout"); 27 | 28 | $exploded = explode(",",$ton_login); 29 | 30 | $ton_expiry = $exploded[1]; 31 | $tprice = $exploded[2]; 32 | $tvalidity = $exploded[3]; 33 | $tgrace_period = $exploded[4]; 34 | $tlock_user = $exploded[6]; 35 | 36 | if($ton_expiry == "rem"){ $tton_expiry = "Remove"; } 37 | elseif ($ton_expiry == "ntf"){ $tton_expiry = "Notice"; } 38 | elseif ($ton_expiry == "remc") { $tton_expiry = "Remove & Record"; } 39 | elseif ($ton_expiry == "ntfc") { $tton_expiry = "Notice & Record"; } 40 | else $tton_expiry = "0"; 41 | 42 | 43 | $arr = array('name' => $tname, 'address_pool' => $taddress_pool, 'rate_limit' => $trate_limit, 'session_timeout' => $tsession_timeout, 44 | 'shared_users' => $tshared_users, 'mac_cookie_timeout' => $tmac_cookie_timeout, 45 | 'keepalive_timeout' => $tkeepalive_timeout, 'on_expiry' => $ton_expiry, 'price' => $tprice, 'validity' => $tvalidity, 46 | 'grace_period' => $tgrace_period, 'lock_user' => $tlock_user ); 47 | 48 | echo json_encode($arr); 49 | } 50 | } 51 | ?> -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreArray.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreArray action. 31 | * 32 | * The execute method appends the value of the option entered by the user to 33 | * the result option array entry. 34 | * 35 | * @category Console 36 | * @package PEAR2\Console\CommandLine 37 | * @author David JEAN LOUIS 38 | * @copyright 2007-2009 David JEAN LOUIS 39 | * @license http://opensource.org/licenses/mit-license.php MIT License 40 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 41 | * @since Class available since release 0.1.0 42 | */ 43 | class StoreArray extends CommandLine\Action 44 | { 45 | // Protected properties {{{ 46 | 47 | /** 48 | * Force a clean result when first called, overriding any defaults assigned. 49 | * 50 | * @var object $firstPass First time this action has been called. 51 | */ 52 | protected $firstPass = true; 53 | 54 | // }}} 55 | // execute() {{{ 56 | 57 | /** 58 | * Executes the action with the value entered by the user. 59 | * 60 | * @param mixed $value The option value 61 | * @param array $params An optional array of parameters 62 | * 63 | * @return string 64 | */ 65 | public function execute($value = false, $params = array()) 66 | { 67 | $result = $this->getResult(); 68 | if (null === $result || $this->firstPass) { 69 | $result = array(); 70 | $this->firstPass = false; 71 | } 72 | $result[] = $value; 73 | $this->setResult($result); 74 | } 75 | // }}} 76 | } 77 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreFloat.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreFloat action. 31 | * 32 | * The execute method store the value of the option entered by the user as a 33 | * float in the result option array entry, if the value passed is not a float 34 | * an Exception is raised. 35 | * 36 | * @category Console 37 | * @package PEAR2\Console\CommandLine 38 | * @author David JEAN LOUIS 39 | * @copyright 2007-2009 David JEAN LOUIS 40 | * @license http://opensource.org/licenses/mit-license.php MIT License 41 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 42 | * @since Class available since release 0.1.0 43 | */ 44 | class StoreFloat extends CommandLine\Action 45 | { 46 | // execute() {{{ 47 | 48 | /** 49 | * Executes the action with the value entered by the user. 50 | * 51 | * @param mixed $value The option value 52 | * @param array $params An array of optional parameters 53 | * 54 | * @return string 55 | * @throws PEAR2\Console\CommandLine\Exception 56 | */ 57 | public function execute($value = false, $params = array()) 58 | { 59 | if (!is_numeric($value)) { 60 | throw CommandLine\Exception::factory( 61 | 'OPTION_VALUE_TYPE_ERROR', 62 | array( 63 | 'name' => $this->option->name, 64 | 'type' => 'float', 65 | 'value' => $value 66 | ), 67 | $this->parser 68 | ); 69 | } 70 | $this->setResult((float)$value); 71 | } 72 | // }}} 73 | } 74 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/StoreInt.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the StoreInt action. 31 | * 32 | * The execute method store the value of the option entered by the user as an 33 | * integer in the result option array entry, if the value passed is not an 34 | * integer an Exception is raised. 35 | * 36 | * @category Console 37 | * @package PEAR2\Console\CommandLine 38 | * @author David JEAN LOUIS 39 | * @copyright 2007-2009 David JEAN LOUIS 40 | * @license http://opensource.org/licenses/mit-license.php MIT License 41 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 42 | * @since Class available since release 0.1.0 43 | */ 44 | class StoreInt extends CommandLine\Action 45 | { 46 | // execute() {{{ 47 | 48 | /** 49 | * Executes the action with the value entered by the user. 50 | * 51 | * @param mixed $value The option value 52 | * @param array $params An array of optional parameters 53 | * 54 | * @return string 55 | * @throws PEAR2\Console\CommandLine\Exception 56 | */ 57 | public function execute($value = false, $params = array()) 58 | { 59 | if (!is_numeric($value)) { 60 | throw CommandLine\Exception::factory( 61 | 'OPTION_VALUE_TYPE_ERROR', 62 | array( 63 | 'name' => $this->option->name, 64 | 'type' => 'int', 65 | 'value' => $value 66 | ), 67 | $this->parser 68 | ); 69 | } 70 | $this->setResult((int)$value); 71 | } 72 | // }}} 73 | } 74 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/CustomMessageProvider.php: -------------------------------------------------------------------------------- 1 | 17 | * @author Michael Gauthier 18 | * @copyright 2007 David JEAN LOUIS, 2009 silverorange 19 | * @license http://opensource.org/licenses/mit-license.php MIT License 20 | * @version CVS: $Id: CustomMessageProvider.php 282427 2009-06-19 10:22:48Z izi $ 21 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 22 | * @since File available since release 1.1.0 23 | * @filesource 24 | */ 25 | 26 | namespace PEAR2\Console\CommandLine; 27 | 28 | /** 29 | * Common interfacefor message providers that allow overriding with custom 30 | * messages 31 | * 32 | * Message providers may optionally implement this interface. 33 | * 34 | * @category Console 35 | * @package PEAR2\Console\CommandLine 36 | * @author David JEAN LOUIS 37 | * @author Michael Gauthier 38 | * @copyright 2007 David JEAN LOUIS, 2009 silverorange 39 | * @license http://opensource.org/licenses/mit-license.php MIT License 40 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 41 | * @since Interface available since release 1.1.0 42 | */ 43 | interface CustomMessageProvider 44 | { 45 | // getWithCustomMesssages() {{{ 46 | 47 | /** 48 | * Retrieves the given string identifier corresponding message. 49 | * 50 | * For a list of identifiers please see the provided default message 51 | * provider. 52 | * 53 | * @param string $code The string identifier of the message 54 | * @param array $vars An array of template variables 55 | * @param array $messages An optional array of messages to use. Array 56 | * indexes are message codes. 57 | * 58 | * @return string 59 | * @see PEAR2\Console\CommandLine_MessageProvider 60 | * @see PEAR2\Console\CommandLine_MessageProvider_Default 61 | */ 62 | public function getWithCustomMessages( 63 | $code, $vars = array(), $messages = array() 64 | ); 65 | 66 | // }}} 67 | } 68 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/Counter.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the Version action. 31 | * 32 | * The execute methode add 1 to the value of the result option array entry. 33 | * The value is incremented each time the option is found, for example 34 | * with an option defined like that: 35 | * 36 | * 37 | * $parser->addOption( 38 | * 'verbose', 39 | * array( 40 | * 'short_name' => '-v', 41 | * 'action' => 'Counter' 42 | * ) 43 | * ); 44 | * 45 | * If the user type: 46 | * 47 | * $ script.php -v -v -v 48 | * 49 | * or: 50 | * 51 | * $ script.php -vvv 52 | * 53 | * the verbose variable will be set to to 3. 54 | * 55 | * @category Console 56 | * @package PEAR2\Console\CommandLine 57 | * @author David JEAN LOUIS 58 | * @copyright 2007-2009 David JEAN LOUIS 59 | * @license http://opensource.org/licenses/mit-license.php MIT License 60 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 61 | * @since Class available since release 0.1.0 62 | */ 63 | class Counter extends CommandLine\Action 64 | { 65 | // execute() {{{ 66 | 67 | /** 68 | * Executes the action with the value entered by the user. 69 | * 70 | * @param mixed $value The option value 71 | * @param array $params An optional array of parameters 72 | * 73 | * @return string 74 | */ 75 | public function execute($value = false, $params = array()) 76 | { 77 | $result = $this->getResult(); 78 | if ($result === null) { 79 | $result = 0; 80 | } 81 | $this->setResult(++$result); 82 | } 83 | // }}} 84 | } 85 | -------------------------------------------------------------------------------- /info.php: -------------------------------------------------------------------------------- 1 |

PHP Info of this Machine



'; 3 | echo phpinfo(); 4 | /* 5 | * Md. Nazmul Basher 6 | 7 | 8 | ob_start(); // Turn on output buffering 9 | system(‘ipconfig /all’); //Execute external program to display output 10 | $mycom=ob_get_contents(); // Capture the output into a variable 11 | ob_clean(); // Clean (erase) the output buffer 12 | 13 | $findme = “Physical”; 14 | $pmac = strpos($mycom, $findme); // Find the position of Physical text 15 | $mac=substr($mycom,($pmac+36),17); // Get Physical Address 16 | 17 | 18 | 19 | echo "MAC ID: "; 20 | echo $pmac; 21 | echo $mac; 22 | 23 | function getMacLinux() { 24 | exec('netstat -ie', $result); 25 | if(is_array($result)) { 26 | $iface = array(); 27 | foreach($result as $key => $line) { 28 | if($key > 0) { 29 | $tmp = str_replace(" ", "", substr($line, 0, 10)); 30 | if($tmp <> "") { 31 | $macpos = strpos($line, "HWaddr"); 32 | if($macpos !== false) { 33 | $iface[] = array('iface' => $tmp, 'mac' => strtolower(substr($line, $macpos+7, 17))); 34 | } 35 | } 36 | } 37 | } 38 | return $iface[0]['mac']; 39 | } else { 40 | return "notfound"; 41 | } 42 | } 43 | 44 | echo 'Linux Mac ID : '.getMaclinux(); 45 | 46 | 47 | $ip=$_SERVER['SERVER_ADDR']; 48 | echo "Server IP: {$ip}
49 | Server Mac: "; 50 | $conf=exec('netstat -ie'); 51 | $prots=explode("\n\n",$conf); 52 | if($ip=='127.0.0.1')$ip='192.168.'; 53 | foreach($prots as $prot){ 54 | if(strpos($prot,' addr:'.$ip) && preg_match('/(?:\s+)HWaddr(?:\s+)(?P[a-f0-9\:]+)/',$prot,$match)){ 55 | echo $match['mac']; 56 | } 57 | } 58 | 59 | 60 | $ipAddress=$_SERVER['REMOTE_ADDR']; 61 | $macAddr=false; 62 | 63 | #run the external command, break output into lines 64 | $arp=`arp -a $ipAddress`; 65 | $lines=explode("\n", $arp); 66 | 67 | #look for the output line describing our IP address 68 | foreach($lines as $line) 69 | { 70 | $cols=preg_split('/\s+/', trim($line)); 71 | if ($cols[0]==$ipAddress) 72 | { 73 | $macAddr=$cols[1]; 74 | } 75 | } 76 | echo $lines[1]; 77 | echo $cols[1]; 78 | echo $macAddr; 79 | */ 80 | //=========================================== 81 | ob_start(); 82 | $cmd = system("getmac"); 83 | ob_end_clean(); 84 | echo 'Your MAC ID : '. substr($cmd,0,17); 85 | /* 86 | echo '


'; 87 | echo '
New Get Mac: '.substr($cmd,0,17).'
'; 88 | echo 'Location: '.strstr($cmd, '{'); 89 | $cmd = system("nbtstat -a ip.of.remote.machine"); 90 | echo '
Another ID New Get Mac: '.$cmd; */ 91 | ?> -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/List.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version CVS: $Id: List.php,v 1.2 2009/02/27 08:03:17 izi Exp $ 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Class that represent the List action, a special action that simply output an 29 | * array as a list. 30 | * 31 | * @category Console 32 | * @package PEAR2\Console\CommandLine 33 | * @author David JEAN LOUIS 34 | * @copyright 2007-2009 David JEAN LOUIS 35 | * @license http://opensource.org/licenses/mit-license.php MIT License 36 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 37 | * @since Class available since release 0.1.0 38 | */ 39 | class Action_List extends Action 40 | { 41 | // execute() {{{ 42 | 43 | /** 44 | * Executes the action with the value entered by the user. 45 | * Possible parameters are: 46 | * - message: an alternative message to display instead of the default 47 | * message, 48 | * - delimiter: an alternative delimiter instead of the comma, 49 | * - post: a string to append after the message (default is the new line 50 | * char). 51 | * 52 | * @param mixed $value The option value 53 | * @param array $params An optional array of parameters 54 | * 55 | * @return string 56 | */ 57 | public function execute($value = false, $params = array()) 58 | { 59 | $list = isset($params['list']) ? $params['list'] : array(); 60 | $msg = isset($params['message']) 61 | ? $params['message'] 62 | : $this->parser->message_provider->get('LIST_DISPLAYED_MESSAGE'); 63 | $del = isset($params['delimiter']) ? $params['delimiter'] : ', '; 64 | $post = isset($params['post']) ? $params['post'] : "\n"; 65 | $this->parser->outputter->stdout($msg . implode($del, $list) . $post); 66 | exit(0); 67 | } 68 | // }}} 69 | } 70 | -------------------------------------------------------------------------------- /backup.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 |
8 |
10 | 11 |
12 |
13 | query( 'SHOW TABLES' ); 27 | foreach ( $tables as $table ) { 28 | //echo $table[0] . ' ... '; 29 | flush(); 30 | $sql = '-- TABLE: ' . $table[0] . PHP_EOL; 31 | $create = $DB_con->query( 'SHOW CREATE TABLE `' . $table[0] . '`' )->fetch(); 32 | $sql .= $create['Create Table'] . ';' . PHP_EOL; 33 | fwrite( $f, $sql ); 34 | 35 | $rows = $DB_con->query( 'SELECT * FROM `' . $table[0] . '`' ); 36 | $rows->setFetchMode( PDO::FETCH_ASSOC ); 37 | foreach ( $rows as $row ) { 38 | $row = array_map( array( $DB_con, 'quote' ), $row ); 39 | $sql = 'INSERT INTO `' . $table[0] . '` (`' . implode( '`, `', array_keys( $row ) ) . '`) VALUES (' . implode( ', ', $row ) . ');' . PHP_EOL; 40 | fwrite( $f, $sql ); 41 | } 42 | 43 | $sql = PHP_EOL; 44 | $result = fwrite( $f, $sql ); 45 | if ( $result !== FALSE ) { 46 | echo ''; 47 | } else { 48 | // echo 'ERROR!!' . PHP_EOL; 49 | } 50 | flush(); 51 | } 52 | fclose( $f ); 53 | } catch (Exception $e) { 54 | echo 'Damn it! ' . $e->getMessage() . PHP_EOL; 55 | } 56 | ?> 57 | download> 58 | 59 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/NotSupportedException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | /** 24 | * Base of this class. 25 | */ 26 | use Exception as E; 27 | 28 | /** 29 | * Exception thrown when encountering something not supported by RouterOS or 30 | * this package. 31 | * 32 | * @category Net 33 | * @package PEAR2_Net_RouterOS 34 | * @author Vasil Rangelov 35 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 36 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 37 | */ 38 | class NotSupportedException extends E implements Exception 39 | { 40 | 41 | const CODE_CONTROL_BYTE = 1601; 42 | 43 | /** 44 | * @var mixed The unsuppported value. 45 | */ 46 | private $_value; 47 | 48 | /** 49 | * Creates a new NotSupportedException. 50 | * 51 | * @param string $message The Exception message to throw. 52 | * @param int $code The Exception code. 53 | * @param \Exception $previous The previous exception used for the exception 54 | * chaining. 55 | * @param mixed $value The unsupported value. 56 | */ 57 | public function __construct( 58 | $message, 59 | $code = 0, 60 | $previous = null, 61 | $value = null 62 | ) { 63 | parent::__construct($message, $code, $previous); 64 | $this->_value = $value; 65 | } 66 | 67 | /** 68 | * Gets the unsupported value. 69 | * 70 | * @return mixed The unsupported value. 71 | */ 72 | public function getValue() 73 | { 74 | return $this->_value; 75 | } 76 | 77 | // @codeCoverageIgnoreStart 78 | // String representation is not reliable in testing 79 | 80 | /** 81 | * Returns a string representation of the exception. 82 | * 83 | * @return string The exception as a string. 84 | */ 85 | public function __toString() 86 | { 87 | return parent::__toString() . "\nValue:{$this->_value}"; 88 | } 89 | 90 | // @codeCoverageIgnoreEnd 91 | } 92 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/LengthException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | /** 24 | * Base of this class. 25 | */ 26 | use LengthException as L; 27 | 28 | /** 29 | * Exception thrown when there is a problem with a word's length. 30 | * 31 | * @category Net 32 | * @package PEAR2_Net_RouterOS 33 | * @author Vasil Rangelov 34 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 35 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 36 | */ 37 | class LengthException extends L implements Exception 38 | { 39 | 40 | const CODE_UNSUPPORTED = 1200; 41 | const CODE_INVALID = 1300; 42 | const CODE_BEYOND_SHEME = 1301; 43 | 44 | /** 45 | * 46 | * @var mixed The problematic length. 47 | */ 48 | private $_length; 49 | 50 | /** 51 | * Creates a new LengthException. 52 | * 53 | * @param string $message The Exception message to throw. 54 | * @param int $code The Exception code. 55 | * @param \Exception $previous The previous exception used for the exception 56 | * chaining. 57 | * @param number $length The length. 58 | */ 59 | public function __construct( 60 | $message, 61 | $code = 0, 62 | $previous = null, 63 | $length = null 64 | ) { 65 | parent::__construct($message, $code, $previous); 66 | $this->_length = $length; 67 | } 68 | 69 | /** 70 | * Gets the length. 71 | * 72 | * @return number The length. 73 | */ 74 | public function getLength() 75 | { 76 | return $this->_length; 77 | } 78 | 79 | // @codeCoverageIgnoreStart 80 | // String representation is not reliable in testing 81 | 82 | /** 83 | * Returns a string representation of the exception. 84 | * 85 | * @return string The exception as a string. 86 | */ 87 | public function __toString() 88 | { 89 | return parent::__toString() . "\nLength:{$this->_length}"; 90 | } 91 | 92 | // @codeCoverageIgnoreEnd 93 | } 94 | -------------------------------------------------------------------------------- /PEAR2/Net/RouterOS/UnexpectedValueException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2011 Vasil Rangelov 14 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 15 | * @version 1.0.0b5 16 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 17 | */ 18 | /** 19 | * The namespace declaration. 20 | */ 21 | namespace PEAR2\Net\RouterOS; 22 | 23 | use UnexpectedValueException as U; 24 | 25 | /** 26 | * Exception thrown when encountering an invalid value in a function argument. 27 | * 28 | * @category Net 29 | * @package PEAR2_Net_RouterOS 30 | * @author Vasil Rangelov 31 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 32 | * @link http://pear2.php.net/PEAR2_Net_RouterOS 33 | */ 34 | class UnexpectedValueException extends U implements Exception 35 | { 36 | const CODE_CALLBACK_INVALID = 10502; 37 | const CODE_ACTION_UNKNOWN = 30100; 38 | const CODE_RESPONSE_TYPE_UNKNOWN = 50100; 39 | 40 | /** 41 | * @var mixed The unexpected value. 42 | */ 43 | private $_value; 44 | 45 | /** 46 | * Creates a new UnexpectedValueException. 47 | * 48 | * @param string $message The Exception message to throw. 49 | * @param int $code The Exception code. 50 | * @param \Exception $previous The previous exception used for the exception 51 | * chaining. 52 | * @param mixed $value The unexpected value. 53 | */ 54 | public function __construct( 55 | $message, 56 | $code = 0, 57 | $previous = null, 58 | $value = null 59 | ) { 60 | parent::__construct($message, $code, $previous); 61 | $this->_value = $value; 62 | } 63 | 64 | /** 65 | * Gets the unexpected value. 66 | * 67 | * @return mixed The unexpected value. 68 | */ 69 | public function getValue() 70 | { 71 | return $this->_value; 72 | } 73 | 74 | // @codeCoverageIgnoreStart 75 | // String representation is not reliable in testing 76 | 77 | /** 78 | * Returns a string representation of the exception. 79 | * 80 | * @return string The exception as a string. 81 | */ 82 | public function __toString() 83 | { 84 | return parent::__toString() . "\nValue:{$this->_value}"; 85 | } 86 | 87 | // @codeCoverageIgnoreEnd 88 | } 89 | -------------------------------------------------------------------------------- /PEAR2/Console/Color/Flags.php: -------------------------------------------------------------------------------- 1 | 12 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 13 | * @version 1.0.0 14 | * @link http://pear2.php.net/PEAR2_Console_Color 15 | */ 16 | namespace PEAR2\Console\Color; 17 | 18 | use ReflectionClass; 19 | 20 | /** 21 | * This class has the possibles flags to a color setting. 22 | * 23 | * @category Console 24 | * @package PEAR2_Console_Color 25 | * @author Vasil Rangelov 26 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 27 | * @link http://pear2.php.net/PEAR2_Console_Color 28 | */ 29 | abstract class Flags 30 | { 31 | /** 32 | * Used at {@link \PEAR2\Console\Color::setFlags()} to specify that no 33 | * flags should be applied. 34 | */ 35 | const NONE = 0; 36 | 37 | /** 38 | * Used at {@link \PEAR2\Console\Color::setFlags()} as part of a bitmask. 39 | * If specified, resets all color and style information before applying 40 | * everything else. 41 | */ 42 | const RESET = 1; 43 | 44 | /** 45 | * Used at {@link \PEAR2\Console\Color::setFlags()} as part of a bitmask. 46 | * If specified, inverses the font and background colors, before letting 47 | * the remaining settings further modify things. 48 | * If specified together with {@link self::RESET}, takes effect AFTER the 49 | * reset. 50 | */ 51 | const INVERSE = 2; 52 | 53 | /** 54 | * @var int[] Array with the flag as a key, and the corresponding code as a 55 | * value. 56 | */ 57 | protected static $flagCodes = array( 58 | self::RESET => 0, 59 | self::INVERSE => 7 60 | ); 61 | 62 | /** 63 | * Gets the codes for a flag set. 64 | * 65 | * @param int $flags The flags to get the codes for. 66 | * 67 | * @return int[] The codes for the flags specified, in ascending order, 68 | * based on the flag constants' values. 69 | */ 70 | final public static function getCodes($flags) 71 | { 72 | if (self::NONE === $flags) { 73 | return array(); 74 | } 75 | 76 | $result = array(); 77 | $flagsClass = new ReflectionClass(get_called_class()); 78 | $validFlags = array_values( 79 | array_unique($flagsClass->getConstants(), SORT_NUMERIC) 80 | ); 81 | foreach ($validFlags as $flag) { 82 | if ($flags & $flag) { 83 | $result[] = static::$flagCodes[$flag]; 84 | } 85 | } 86 | return $result; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /modal_delete_guest.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/Callback.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | namespace PEAR2\Console\CommandLine\Action; 25 | 26 | use PEAR2\Console\CommandLine; 27 | 28 | 29 | /** 30 | * Class that represent the Callback action. 31 | * 32 | * The result option array entry value is set to the return value of the 33 | * callback defined in the option. 34 | * 35 | * There are two steps to defining a callback option: 36 | * - define the option itself using the callback action 37 | * - write the callback; this is a function (or method) that takes five 38 | * arguments, as described below. 39 | * 40 | * All callbacks are called as follows: 41 | * 42 | * callable_func( 43 | * $value, // the value of the option 44 | * $option_instance, // the option instance 45 | * $result_instance, // the result instance 46 | * $parser_instance, // the parser instance 47 | * $params // an array of params as specified in the option 48 | * ); 49 | * 50 | * and *must* return the option value. 51 | * 52 | * @category Console 53 | * @package PEAR2\Console\CommandLine 54 | * @author David JEAN LOUIS 55 | * @copyright 2007-2009 David JEAN LOUIS 56 | * @license http://opensource.org/licenses/mit-license.php MIT License 57 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 58 | * @since Class available since release 0.1.0 59 | */ 60 | class Callback extends CommandLine\Action 61 | { 62 | // execute() {{{ 63 | 64 | /** 65 | * Executes the action with the value entered by the user. 66 | * 67 | * @param mixed $value The value of the option 68 | * @param array $params An optional array of parameters 69 | * 70 | * @return string 71 | */ 72 | public function execute($value = false, $params = array()) 73 | { 74 | $this->setResult( 75 | call_user_func( 76 | $this->option->callback, 77 | $value, 78 | $this->option, 79 | $this->result, 80 | $this->parser, 81 | $params 82 | ) 83 | ); 84 | } 85 | // }}} 86 | } 87 | -------------------------------------------------------------------------------- /settings.php: -------------------------------------------------------------------------------- 1 | "; 13 | try { 14 | file_put_contents($file, $message); 15 | echo ''; 16 | } 17 | catch(PDOException $e) { 18 | echo ''; 19 | } 20 | } 21 | ?> 22 |
23 |
24 |

Easy Hotspot

25 |

Simple HotSpot User Management Utility

26 |

By TEAM ZETOZONE

27 |
28 |
29 |
30 |
31 |
32 |

Please update the below settings

33 |
34 |
35 |
36 |
37 | 38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 | 46 |
47 |
48 |
49 | 50 |
51 | 52 |
53 |
54 |
55 |
56 | 57 |
58 |
59 | 60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
-------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action/Password.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine\Action; 26 | 27 | use PEAR2\Console\CommandLine; 28 | 29 | /** 30 | * Class that represent the Password action, a special action that allow the 31 | * user to specify the password on the commandline or to be prompted for 32 | * entering it. 33 | * 34 | * @category Console 35 | * @package PEAR2\Console\CommandLine 36 | * @author David JEAN LOUIS 37 | * @copyright 2007-2009 David JEAN LOUIS 38 | * @license http://opensource.org/licenses/mit-license.php MIT License 39 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 40 | * @since Class available since release 0.1.0 41 | */ 42 | class Password extends CommandLine\Action 43 | { 44 | // execute() {{{ 45 | 46 | /** 47 | * Executes the action with the value entered by the user. 48 | * 49 | * @param mixed $value The option value 50 | * @param array $params An array of optional parameters 51 | * 52 | * @return string 53 | */ 54 | public function execute($value = false, $params = array()) 55 | { 56 | $this->setResult(empty($value) ? $this->_promptPassword() : $value); 57 | } 58 | // }}} 59 | // _promptPassword() {{{ 60 | 61 | /** 62 | * Prompts the password to the user without echoing it. 63 | * 64 | * @return string 65 | * @todo not echo-ing the password does not work on windows is there a way 66 | * to make this work ? 67 | */ 68 | private function _promptPassword() 69 | { 70 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { 71 | fwrite( 72 | STDOUT, 73 | $this->parser->message_provider->get('PASSWORD_PROMPT_ECHO') 74 | ); 75 | @flock(STDIN, LOCK_EX); 76 | $passwd = fgets(STDIN); 77 | @flock(STDIN, LOCK_UN); 78 | } else { 79 | fwrite(STDOUT, $this->parser->message_provider->get('PASSWORD_PROMPT')); 80 | // disable echoing 81 | system('stty -echo'); 82 | @flock(STDIN, LOCK_EX); 83 | $passwd = fgets(STDIN); 84 | @flock(STDIN, LOCK_UN); 85 | system('stty echo'); 86 | } 87 | return trim($passwd); 88 | } 89 | // }}} 90 | } 91 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Argument.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Class that represent a command line argument. 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | class Argument extends Element 39 | { 40 | // Public properties {{{ 41 | 42 | /** 43 | * Setting this to true will tell the parser that the argument expects more 44 | * than one argument and that argument values should be stored in an array. 45 | * 46 | * @var boolean $multiple Whether the argument expects multiple values 47 | */ 48 | public $multiple = false; 49 | 50 | /** 51 | * Setting this to true will tell the parser that the argument is optional 52 | * and can be ommited. 53 | * Note that it is not a good practice to make arguments optional, it is 54 | * the role of the options to be optional, by essence. 55 | * 56 | * @var boolean $optional Whether the argument is optional or not. 57 | */ 58 | public $optional = false; 59 | 60 | // }}} 61 | // validate() {{{ 62 | 63 | /** 64 | * Validates the argument instance. 65 | * 66 | * @return void 67 | * @throws PEAR2\Console\CommandLine\Exception 68 | * @todo use exceptions 69 | */ 70 | public function validate() 71 | { 72 | // check if the argument name is valid 73 | if (!preg_match( 74 | '/^[a-zA-Z_\x7f-\xff]+[a-zA-Z0-9_\x7f-\xff]*$/', 75 | $this->name 76 | ) 77 | ) { 78 | \PEAR2\Console\CommandLine::triggerError( 79 | 'argument_bad_name', 80 | E_USER_ERROR, 81 | array('{$name}' => $this->name) 82 | ); 83 | } 84 | if (!$this->optional && $this->default !== null) { 85 | \PEAR2\Console\CommandLine::triggerError( 86 | 'argument_no_default', 87 | E_USER_ERROR 88 | ); 89 | } 90 | parent::validate(); 91 | } 92 | 93 | // }}} 94 | } 95 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Exception.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | use Exception as E; 28 | 29 | /** 30 | * Class for exceptions raised by the PEAR2\Console\CommandLine package. 31 | * 32 | * @category Console 33 | * @package PEAR2\Console\CommandLine 34 | * @author David JEAN LOUIS 35 | * @copyright 2007-2009 David JEAN LOUIS 36 | * @license http://opensource.org/licenses/mit-license.php MIT License 37 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 38 | * @since Class available since release 0.1.0 39 | */ 40 | class Exception extends E 41 | { 42 | // Codes constants {{{ 43 | 44 | /**#@+ 45 | * Exception code constants. 46 | */ 47 | const OPTION_VALUE_REQUIRED = 1; 48 | const OPTION_VALUE_UNEXPECTED = 2; 49 | const OPTION_VALUE_TYPE_ERROR = 3; 50 | const OPTION_UNKNOWN = 4; 51 | const ARGUMENT_REQUIRED = 5; 52 | const INVALID_SUBCOMMAND = 6; 53 | /**#@-*/ 54 | 55 | // }}} 56 | // factory() {{{ 57 | 58 | /** 59 | * Convenience method that builds the exception with the array of params by 60 | * calling the message provider class. 61 | * 62 | * @param string $code The string identifier of the 63 | * exception. 64 | * @param array $params Array of template vars/values 65 | * @param PEAR2\Console\CommandLine $parser An instance of the parser 66 | * @param array $messages An optional array of messages 67 | * passed to the message provider. 68 | * 69 | * @return PEAR2\Console\CommandLine\Exception The exception instance 70 | */ 71 | public static function factory( 72 | $code, $params, $parser, array $messages = array() 73 | ) { 74 | $provider = $parser->message_provider; 75 | if ($provider instanceof CommandLine\CustomMessageProvider) { 76 | $msg = $provider->getWithCustomMessages( 77 | $code, 78 | $params, 79 | $messages 80 | ); 81 | } else { 82 | $msg = $provider->get($code, $params); 83 | } 84 | $const = '\PEAR2\Console\CommandLine\Exception::' . $code; 85 | $code = defined($const) ? constant($const) : 0; 86 | return new static($msg, $code); 87 | } 88 | 89 | // }}} 90 | } 91 | -------------------------------------------------------------------------------- /db_backup_20_09_2016_14_11_47.sql: -------------------------------------------------------------------------------- 1 | -- TABLE: hotspot_customers 2 | CREATE TABLE `hotspot_customers` ( 3 | `id` int(11) NOT NULL AUTO_INCREMENT, 4 | `customer_id` varchar(30) NOT NULL, 5 | `company` varchar(64) NOT NULL, 6 | `address` varchar(128) NOT NULL, 7 | `telephone` varchar(30) NOT NULL, 8 | `mobile` varchar(30) NOT NULL, 9 | `email` varchar(30) NOT NULL, 10 | `state` varchar(30) NOT NULL, 11 | `country` varchar(30) NOT NULL, 12 | `validity` varchar(10) NOT NULL, 13 | `created_on` datetime DEFAULT NULL, 14 | `valid_till` datetime DEFAULT NULL, 15 | `pub_key` varchar(30) NOT NULL, 16 | `priv_key` varchar(30) NOT NULL, 17 | `hits` int(11) DEFAULT '0', 18 | `error_hit` int(11) DEFAULT '0', 19 | `comment` varchar(50) NOT NULL, 20 | `ip` varchar(15) NOT NULL, 21 | `mac_id` varchar(30) NOT NULL, 22 | `status` varchar(15) NOT NULL, 23 | PRIMARY KEY (`id`) 24 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 25 | INSERT INTO `hotspot_customers` (`id`, `customer_id`, `company`, `address`, `telephone`, `mobile`, `email`, `state`, `country`, `validity`, `created_on`, `valid_till`, `pub_key`, `priv_key`, `hits`, `error_hit`, `comment`, `ip`, `mac_id`, `status`) VALUES ('1', 'jaison123', 'Inspire Digital Solutions', 'Karippayil Building, NH 183, Kumily - 685 509', 'telephone', 'mobile', 'mail@zetone.com', 'Tamilnadu', 'Pakistan', '1 Month', '2016-09-16 00:00:00', '2016-10-20 00:00:00', 'J3NZY-L9NAW-52MY2-I5P9H-L2U3L', 'WKTQN-P359T-NP7EO-DXXY2-S3ZMD', '7', '4', '00-16-EA-7C-10-38', '', '00-16-EA-7C-10-38', 'Active'); 26 | INSERT INTO `hotspot_customers` (`id`, `customer_id`, `company`, `address`, `telephone`, `mobile`, `email`, `state`, `country`, `validity`, `created_on`, `valid_till`, `pub_key`, `priv_key`, `hits`, `error_hit`, `comment`, `ip`, `mac_id`, `status`) VALUES ('2', 'Jinu Devasia', 'Zetozone Technologies', 'Karippayil Building, NH 183, Kumily - 685 509', '9961144235', '9656224691', 'jinu@live.in', 'Kerala', 'India', 'Lifetime', '2016-09-20 00:00:00', '2019-06-16 00:00:00', 'JF94O-YBA7B-ZSHHF-KFABI-JUWP2', 'UUY5G-QZB7L-59HDW-SSE9L-TFIJF', '0', '0', '', '', '18:10:18', 'Deleted'); 27 | 28 | -- TABLE: hotspot_users 29 | CREATE TABLE `hotspot_users` ( 30 | `user_id` int(11) NOT NULL AUTO_INCREMENT, 31 | `email` varchar(200) NOT NULL, 32 | `date_added` date NOT NULL, 33 | `firstname` varchar(30) NOT NULL, 34 | `lastname` varchar(30) NOT NULL, 35 | `password` varchar(60) NOT NULL, 36 | `created_at` datetime NOT NULL, 37 | `username` varchar(30) NOT NULL, 38 | `user_level` int(11) NOT NULL DEFAULT '3', 39 | `user_group` int(1) NOT NULL, 40 | `image_path` varchar(50) NOT NULL, 41 | `thumb_path` varchar(50) NOT NULL, 42 | `status` varchar(20) NOT NULL, 43 | PRIMARY KEY (`user_id`), 44 | KEY `username` (`username`) 45 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; 46 | INSERT INTO `hotspot_users` (`user_id`, `email`, `date_added`, `firstname`, `lastname`, `password`, `created_at`, `username`, `user_level`, `user_group`, `image_path`, `thumb_path`, `status`) VALUES ('1', '', '2016-09-20', 'Administrator', '', 'd033e22ae348aeb5660fc2140aec35850c4da997', '2016-09-20 11:49:31', 'admin', '1', '1', '', '', 'Active'); 47 | INSERT INTO `hotspot_users` (`user_id`, `email`, `date_added`, `firstname`, `lastname`, `password`, `created_at`, `username`, `user_level`, `user_group`, `image_path`, `thumb_path`, `status`) VALUES ('3', '', '2016-09-20', 'Head User', 'Master', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', '0000-00-00 00:00:00', 'admin2', '3', '0', '', '', 'Active'); -------------------------------------------------------------------------------- /modal_get_user.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modal_change_pass.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 |
6 |
7 |

Easy Hotspot

8 |

Simple HotSpot User Management Utility

9 |

By TEAM ZETOZONE

10 |
11 |
12 |
13 |
14 |
15 |

Login using Registered Credentials

16 |
17 |
18 |
19 |
20 | 21 |
22 | 23 |
24 |
25 |
26 | 27 |
28 | 29 |
30 |
31 |
32 |
33 | 34 |
35 |
36 | 37 |
38 |
39 |
40 | prepare("SELECT user_id FROM hotspot_users WHERE 1"); 49 | $stmt->execute(array()); 50 | } 51 | catch(PDOException $e) { 52 | try { 53 | include('database.php'); 54 | $stmt = $DB_con->prepare("SELECT user_id FROM hotspot_users WHERE 1"); 55 | $stmt->execute(array()); 56 | } 57 | catch(PDOException $e) { 58 | echo "Error Accessing Data: " . $e->getMessage(); 59 | } 60 | } 61 | 62 | $count = $stmt->rowCount(); 63 | if( $count == 0 ) { 64 | $password = sha1('admin'); 65 | $stmt = $DB_con->prepare("insert into hotspot_users (date_added, firstname, username, password, user_level, status, user_group, created_at) 66 | values(CURDATE(), 'Administrator', :username, :password, :level, 'Active', 1, NOW())"); 67 | $stmt->execute(array(':username' => 'admin', ':password' => $password, ':level' => 1)); 68 | } 69 | try 70 | { 71 | $stmt = $DB_con->prepare("SELECT * FROM hotspot_users WHERE username=:username AND password =:password AND status =:status"); 72 | $stmt->execute(array(':username' => $username, ':password' => $password, ':status' => 'Active')); 73 | $count = $stmt->rowCount(); 74 | } 75 | catch(PDOException $e) { 76 | echo "Error: " . $e->getMessage(); 77 | } 78 | 79 | if( $count == 1 ) { 80 | $row=$stmt->fetch(PDO::FETCH_ASSOC); 81 | 82 | $_SESSION['id']=$row['user_id']; 83 | $_SESSION['username']=$row['firstname'].' '.$row['lastname']; 84 | $_SESSION['user_level']= $row['user_level']; 85 | echo ''; 86 | } 87 | else 88 | { 89 | echo ''; 90 | } 91 | } 92 | ?> 93 |
94 |
95 |
96 |
97 |
-------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Action.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | namespace PEAR2\Console\CommandLine; 25 | 26 | /** 27 | * Class that represent an option action. 28 | * 29 | * @category Console 30 | * @package PEAR2\Console\CommandLine 31 | * @author David JEAN LOUIS 32 | * @copyright 2007-2009 David JEAN LOUIS 33 | * @license http://opensource.org/licenses/mit-license.php MIT License 34 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 35 | * @since Class available since release 0.1.0 36 | */ 37 | abstract class Action 38 | { 39 | // Properties {{{ 40 | 41 | /** 42 | * A reference to the result instance. 43 | * 44 | * @var PEAR2\Console\CommandLine_Result $result The result instance 45 | */ 46 | protected $result; 47 | 48 | /** 49 | * A reference to the option instance. 50 | * 51 | * @var PEAR2\Console\CommandLine_Option $option The action option 52 | */ 53 | protected $option; 54 | 55 | /** 56 | * A reference to the parser instance. 57 | * 58 | * @var PEAR2\Console\CommandLine $parser The parser 59 | */ 60 | protected $parser; 61 | 62 | // }}} 63 | // __construct() {{{ 64 | 65 | /** 66 | * Constructor 67 | * 68 | * @param PEAR2\Console\CommandLine_Result $result The result instance 69 | * @param PEAR2\Console\CommandLine_Option $option The action option 70 | * @param PEAR2\Console\CommandLine $parser The current parser 71 | * 72 | * @return void 73 | */ 74 | public function __construct($result, $option, $parser) 75 | { 76 | $this->result = $result; 77 | $this->option = $option; 78 | $this->parser = $parser; 79 | } 80 | 81 | // }}} 82 | // getResult() {{{ 83 | 84 | /** 85 | * Convenience method to retrieve the value of result->options[name]. 86 | * 87 | * @return mixed The result value or null 88 | */ 89 | public function getResult() 90 | { 91 | if (isset($this->result->options[$this->option->name])) { 92 | return $this->result->options[$this->option->name]; 93 | } 94 | return null; 95 | } 96 | 97 | // }}} 98 | // format() {{{ 99 | 100 | /** 101 | * Allow a value to be pre-formatted prior to being used in a choices test. 102 | * Setting $value to the new format will keep the formatting. 103 | * 104 | * @param mixed &$value The value to format 105 | * 106 | * @return mixed The formatted value 107 | */ 108 | public function format(&$value) 109 | { 110 | return $value; 111 | } 112 | 113 | // }}} 114 | // setResult() {{{ 115 | 116 | /** 117 | * Convenience method to assign the result->options[name] value. 118 | * 119 | * @param mixed $result The result value 120 | * 121 | * @return void 122 | */ 123 | public function setResult($result) 124 | { 125 | $this->result->options[$this->option->name] = $result; 126 | } 127 | 128 | // }}} 129 | // execute() {{{ 130 | 131 | /** 132 | * Executes the action with the value entered by the user. 133 | * All children actions must implement this method. 134 | * 135 | * @param mixed $value The option value 136 | * @param array $params An optional array of parameters 137 | * 138 | * @return string 139 | */ 140 | abstract public function execute($value = false, $params = array()); 141 | // }}} 142 | } 143 | -------------------------------------------------------------------------------- /PEAR2/Console/Color/Fonts.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 12 | * @version 1.0.0 13 | * @link http://pear2.php.net/PEAR2_Console_Color 14 | */ 15 | namespace PEAR2\Console\Color; 16 | 17 | /** 18 | * This class has the possibles values to a Font Color. 19 | * 20 | * @category Console 21 | * @package PEAR2_Console_Color 22 | * @author Ivo Nascimento 23 | * @copyright 2011 Ivo Nascimento 24 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 25 | * @link http://pear2.php.net/PEAR2_Console_Color 26 | */ 27 | abstract class Fonts 28 | { 29 | /** 30 | * Used at {@link \PEAR2\Console\Color::setFont()} to specify that 31 | * the font color already in effect should be kept. 32 | */ 33 | const KEEP = null; 34 | 35 | /** 36 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 37 | * font color to black/grey (implementation defined). 38 | */ 39 | const BLACK = 30; 40 | 41 | /** 42 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 43 | * font color to black/grey (implementation defined). 44 | */ 45 | const GREY = 30; 46 | 47 | /** 48 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 49 | * font color to maroon/red (implementation defined). 50 | */ 51 | const MAROON = 31; 52 | 53 | /** 54 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 55 | * font color to maroon/red (implementation defined). 56 | */ 57 | const RED = 31; 58 | 59 | /** 60 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 61 | * font color to green/lime (implementation defined). 62 | */ 63 | const LIME = 32; 64 | 65 | /** 66 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 67 | * font color to green/lime (implementation defined). 68 | */ 69 | const GREEN = 32; 70 | 71 | /** 72 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 73 | * font color to brown/yellow (implementation defined). 74 | */ 75 | const BROWN = 33; 76 | 77 | /** 78 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 79 | * font color to brown/yellow (implementation defined). 80 | */ 81 | const YELLOW = 33; 82 | 83 | /** 84 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 85 | * font color to navy/blue (implementation defined). 86 | */ 87 | const NAVY = 34; 88 | 89 | /** 90 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 91 | * font color to navy/blue (implementation defined). 92 | */ 93 | const BLUE = 34; 94 | 95 | /** 96 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 97 | * font color to purple/magenta (implementation defined). 98 | */ 99 | const PURPLE = 35; 100 | 101 | /** 102 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 103 | * font color to purple/magenta (implementation defined). 104 | */ 105 | const MAGENTA = 35; 106 | 107 | /** 108 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 109 | * font color to teal/cyan (implementation defined). 110 | */ 111 | const TEAL = 36; 112 | 113 | /** 114 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 115 | * font color to teal/cyan (implementation defined). 116 | */ 117 | const CYAN = 36; 118 | 119 | /** 120 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 121 | * font color to silver/white (implementation defined). 122 | */ 123 | const SILVER = 37; 124 | 125 | /** 126 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 127 | * font color to silver/white (implementation defined). 128 | */ 129 | const WHITE = 37; 130 | 131 | /** 132 | * Used at {@link \PEAR2\Console\Color::setFont()} to set the 133 | * font color to whatever the default one is. 134 | */ 135 | const RESET = 39; 136 | } 137 | -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/Element.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Class that represent a command line element (an option, or an argument). 29 | * 30 | * @category Console 31 | * @package PEAR2\Console\CommandLine 32 | * @author David JEAN LOUIS 33 | * @copyright 2007-2009 David JEAN LOUIS 34 | * @license http://opensource.org/licenses/mit-license.php MIT License 35 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 36 | * @since Class available since release 0.1.0 37 | */ 38 | abstract class Element 39 | { 40 | // Public properties {{{ 41 | 42 | /** 43 | * The element name. 44 | * 45 | * @var string $name Element name 46 | */ 47 | public $name; 48 | 49 | /** 50 | * The name of variable displayed in the usage message, if no set it 51 | * defaults to the "name" property. 52 | * 53 | * @var string $help_name Element "help" variable name 54 | */ 55 | public $help_name; 56 | 57 | /** 58 | * The element description. 59 | * 60 | * @var string $description Element description 61 | */ 62 | public $description; 63 | /** 64 | * The default value of the element if not provided on the command line. 65 | * 66 | * @var mixed $default Default value of the option. 67 | */ 68 | public $default; 69 | 70 | /** 71 | * Custom errors messages for this element 72 | * 73 | * This array is of the form: 74 | * 75 | * $messageText, 78 | * $messageName => $messageText, 79 | * ... 80 | * ); 81 | * ?> 82 | * 83 | * 84 | * If specified, these messages override the messages provided by the 85 | * default message provider. For example: 86 | * 87 | * 'The argument foo is required.', 90 | * ); 91 | * ?> 92 | * 93 | * 94 | * @var array 95 | * @see PEAR2\Console\CommandLine_MessageProvider_Default 96 | */ 97 | public $messages = array(); 98 | 99 | // }}} 100 | // __construct() {{{ 101 | 102 | /** 103 | * Constructor. 104 | * 105 | * @param string $name The name of the element 106 | * @param array $params An optional array of parameters 107 | * 108 | * @return void 109 | */ 110 | public function __construct($name = null, $params = array()) 111 | { 112 | $this->name = $name; 113 | foreach ($params as $attr => $value) { 114 | if (property_exists($this, $attr)) { 115 | $this->$attr = $value; 116 | } 117 | } 118 | } 119 | 120 | // }}} 121 | // toString() {{{ 122 | 123 | /** 124 | * Returns the string representation of the element. 125 | * 126 | * @return string The string representation of the element 127 | * @todo use __toString() instead 128 | */ 129 | public function toString() 130 | { 131 | return $this->help_name; 132 | } 133 | // }}} 134 | // validate() {{{ 135 | 136 | /** 137 | * Validates the element instance and set it's default values. 138 | * 139 | * @return void 140 | * @throws PEAR2\Console\CommandLine\Exception 141 | */ 142 | public function validate() 143 | { 144 | // if no help_name passed, default to name 145 | if ($this->help_name == null) { 146 | $this->help_name = $this->name; 147 | } 148 | } 149 | 150 | // }}} 151 | } 152 | -------------------------------------------------------------------------------- /PEAR2/Console/Color/Backgrounds.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 12 | * @version 1.0.0 13 | * @link http://pear2.php.net/PEAR2_Console_Color 14 | */ 15 | namespace PEAR2\Console\Color; 16 | 17 | /** 18 | * This class has the possibles values to a Background Color. 19 | * 20 | * @category Console 21 | * @package PEAR2_Console_Color 22 | * @author Ivo Nascimento 23 | * @copyright 2011 Ivo Nascimento 24 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 25 | * @link http://pear2.php.net/PEAR2_Console_Color 26 | */ 27 | abstract class Backgrounds 28 | { 29 | /** 30 | * Used at {@link \PEAR2\Console\Color::setBackground()} to specify that 31 | * the background color already in effect should be kept. 32 | */ 33 | const KEEP = null; 34 | 35 | /** 36 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 37 | * background color to black/grey (implmementation defined). 38 | */ 39 | const BLACK = 40; 40 | 41 | /** 42 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 43 | * background color to black/grey (implementation defined). 44 | */ 45 | const GREY = 40; 46 | 47 | /** 48 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 49 | * background color to maroon/red (implementation defined). 50 | */ 51 | const MAROON = 41; 52 | 53 | /** 54 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 55 | * background color to maroon/red (implementation defined). 56 | */ 57 | const RED = 41; 58 | 59 | /** 60 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 61 | * background color to green/lime (implementation defined). 62 | */ 63 | const GREEN = 42; 64 | 65 | /** 66 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 67 | * background color to green/lime (implementation defined). 68 | */ 69 | const LIME = 42; 70 | 71 | /** 72 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 73 | * background color to brown/yellow (implementation defined). 74 | */ 75 | const BROWN = 43; 76 | 77 | /** 78 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 79 | * background color to brown/yellow (implementation defined). 80 | */ 81 | const YELLOW = 43; 82 | 83 | /** 84 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 85 | * background color to navy/blue (implementation defined). 86 | */ 87 | const NAVY = 44; 88 | 89 | /** 90 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 91 | * background color to navy/blue (implementation defined). 92 | */ 93 | const BLUE = 44; 94 | 95 | /** 96 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 97 | * background color to purple/magenta (implementation defined). 98 | */ 99 | const PURPLE = 45; 100 | 101 | /** 102 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 103 | * background color to purple/magenta (implementation defined). 104 | */ 105 | const MAGENTA = 45; 106 | 107 | /** 108 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 109 | * background color to teal/cyan (implementation defined). 110 | */ 111 | const TEAL = 46; 112 | 113 | /** 114 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 115 | * background color to teal/cyan (implementation defined). 116 | */ 117 | const CYAN = 46; 118 | 119 | /** 120 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 121 | * background color to silver/white (implementation defined). 122 | */ 123 | const SILVER = 47; 124 | 125 | /** 126 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 127 | * background color to silver/white (implementation defined). 128 | */ 129 | const WHITE = 47; 130 | 131 | /** 132 | * Used at {@link \PEAR2\Console\Color::setBackground()} to set the 133 | * background color to whatever the default one is. 134 | */ 135 | const RESET = 49; 136 | } 137 | -------------------------------------------------------------------------------- /css/customModal.css: -------------------------------------------------------------------------------- 1 | .custom-modal { 2 | display: none; 3 | position: fixed; 4 | z-index: 1053; 5 | left: 0; 6 | top: 0; 7 | width: 100%; 8 | height: 100%; 9 | overflow: auto; 10 | background-color: rgb(0,0,0); 11 | background-color: rgba(0,0,0,0.5); 12 | } 13 | 14 | .cmodal-content { 15 | position: relative; 16 | margin: 10% auto; 17 | border: 1px solid #888; 18 | border-radius: 10px; 19 | width: 40%; 20 | box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); 21 | -webkit-animation: cmodalmove .4s ; 22 | -o-animation: cmodalmove .4s; 23 | -moz-animation: cmodalmove .4s; 24 | animation: cmodalmove .4s; 25 | } 26 | 27 | @-webkit-keyframes cmodalmove { 28 | 0% {top:-400px;} 29 | 100% {top:0px;} 30 | } 31 | 32 | @keyframes cmodalmove { 33 | 0% {top:-400px;} 34 | 100% {top:0px;} 35 | } 36 | 37 | .cmodal-header { 38 | display: block; 39 | height: fit-content; 40 | width: 100%; 41 | border-radius: 10px 10px 0px 0px; 42 | background-color: rgb(0,0,0); 43 | background-color: rgba(0,0,0,0.25); 44 | color: white; 45 | padding: -30px; 46 | } 47 | 48 | .cmodal-title { 49 | font-size: 1.08em; 50 | display: inline; 51 | padding: 10px; 52 | font-weight: 500; 53 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 54 | } 55 | 56 | .cmodal-close:hover { 57 | background-color: orangered; 58 | } 59 | 60 | .cmodal-close { 61 | float: right; 62 | height: 100%; 63 | border-color: rgba(0,0,0,0); 64 | border-radius: 5px 5px 0px 5px; 65 | text-align: center; 66 | font-weight: bold; 67 | box-shadow: none; 68 | background: lightgrey; 69 | cursor: pointer; 70 | } 71 | 72 | .cmodal-body { 73 | display: inline; 74 | } 75 | 76 | .cmodal-message { 77 | display: block; 78 | padding: 20px 10px; 79 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 80 | } 81 | 82 | .cmodal-icon { 83 | float: right; 84 | } 85 | 86 | .cmodal-footer { 87 | display: block; 88 | z-index: -1; 89 | border-radius: 0px 0px 10px 10px; 90 | background-color: rgb(255,255,255); 91 | background-color: rgba(255,255,255,.4); 92 | text-align: right; 93 | } 94 | 95 | .cmodal-button { 96 | display: inline; 97 | margin: 3px 3px; 98 | padding: 3px; 99 | color: white; 100 | min-width: 70px; 101 | cursor: pointer; 102 | border-radius: 6px; 103 | border-color: black; 104 | border-color: rgba(0,0,0,0); 105 | -webkit-transition: all .2s; 106 | -moz-transition: all .2s; 107 | transition: all .2s; 108 | text-decoration: none; 109 | text-align: center; 110 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 111 | } 112 | 113 | .cmodal-button:hover { 114 | opacity: .95; 115 | box-shadow: 2px 2px 1px black; 116 | } 117 | 118 | .cmodal-ok { 119 | background: green; 120 | background: linear-gradient( green, mediumseagreen); 121 | } 122 | 123 | .cmodal-cancel { 124 | background: red; 125 | background: linear-gradient( red, indianred); 126 | } 127 | 128 | .cmodal-generic { 129 | background: purple; 130 | background: linear-gradient( purple, mediumpurple); 131 | } 132 | 133 | .cmodal-blue { 134 | background-color: skyblue; 135 | background: linear-gradient( dodgerblue, deepskyblue); 136 | } 137 | 138 | .error { 139 | background: red; 140 | background: -moz-linear-gradient(red, indianred); 141 | background: -webkit-linear-gradient(red, indianred); 142 | background: -o-linear-gradient(red, indianred); 143 | background: linear-gradient(red, indianred); 144 | } 145 | 146 | .information { 147 | background: dodgerblue; 148 | background: -moz-linear-gradient(dodgerblue, lightblue); 149 | background: -webkit-linear-gradient(dodgerblue, lightblue); 150 | background: -o-linear-gradient(dodgerblue, lightblue); 151 | background: linear-gradient(dodgerblue, lightblue); 152 | } 153 | 154 | .success { 155 | background: green; 156 | background: -moz-linear-gradient(green, mediumseagreen); 157 | background: -webkit-linear-gradient(green, mediumseagreen); 158 | background: -o-linear-gradient(green, mediumseagreen); 159 | background: linear-gradient(green, mediumseagreen); 160 | } 161 | 162 | .warning { 163 | background: darkorange; 164 | background: -moz-linear-gradient(orangered, darkorange); 165 | background: -webkit-linear-gradient(orangered, darkorange); 166 | background: -o-linear-gradient(orangered, darkorange); 167 | background: linear-gradient(orangered, darkorange); 168 | } -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/SocketException.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | /** 26 | * Used to enable any exception in chaining. 27 | */ 28 | use Exception as E; 29 | 30 | /** 31 | * Exception thrown when something goes wrong with the connection. 32 | * 33 | * @category Net 34 | * @package PEAR2_Net_Transmitter 35 | * @author Vasil Rangelov 36 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 37 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 38 | */ 39 | class SocketException extends StreamException 40 | { 41 | 42 | /** 43 | * @var int The system level error code. 44 | */ 45 | protected $errorNo; 46 | 47 | /** 48 | * @var string The system level error message. 49 | */ 50 | protected $errorStr; 51 | 52 | /** 53 | * Creates a new socket exception. 54 | * 55 | * @param string $message The Exception message to throw. 56 | * @param int $code The Exception code. 57 | * @param E|null $previous Previous exception thrown, 58 | * or NULL if there is none. 59 | * @param int|string|resource|null $fragment The fragment up until the 60 | * point of failure. 61 | * On failure with sending, this is the number of bytes sent 62 | * successfully before the failure. 63 | * On failure when receiving, this is a string/stream holding 64 | * the contents received successfully before the failure. 65 | * NULL if the failure occured before the operation started. 66 | * @param int $errorNo The system level error number. 67 | * @param string $errorStr The system level 68 | * error message. 69 | */ 70 | public function __construct( 71 | $message = '', 72 | $code = 0, 73 | E $previous = null, 74 | $fragment = null, 75 | $errorNo = null, 76 | $errorStr = null 77 | ) { 78 | parent::__construct($message, $code, $previous, $fragment); 79 | $this->errorNo = $errorNo; 80 | $this->errorStr = $errorStr; 81 | } 82 | 83 | /** 84 | * Gets the system level error code on the socket. 85 | * 86 | * @return int The system level error number. 87 | */ 88 | public function getSocketErrorNumber() 89 | { 90 | return $this->errorNo; 91 | } 92 | 93 | // @codeCoverageIgnoreStart 94 | // Unreliable in testing. 95 | 96 | /** 97 | * Gets the system level error message on the socket. 98 | * 99 | * @return string The system level error message. 100 | */ 101 | public function getSocketErrorMessage() 102 | { 103 | return $this->errorStr; 104 | } 105 | 106 | /** 107 | * Returns a string representation of the exception. 108 | * 109 | * @return string The exception as a string. 110 | */ 111 | public function __toString() 112 | { 113 | $result = parent::__toString(); 114 | if (null !== $this->getSocketErrorNumber()) { 115 | $result .= "\nSocket error number:" . $this->getSocketErrorNumber(); 116 | } 117 | if (null !== $this->getSocketErrorMessage()) { 118 | $result .= "\nSocket error message:" 119 | . $this->getSocketErrorMessage(); 120 | } 121 | return $result; 122 | } 123 | // @codeCoverageIgnoreEnd 124 | } 125 | -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/StreamException.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | /** 26 | * Base for this exception. 27 | */ 28 | use RuntimeException; 29 | 30 | /** 31 | * Used to enable any exception in chaining. 32 | */ 33 | use Exception as E; 34 | 35 | /** 36 | * Exception thrown when something goes wrong with the connection. 37 | * 38 | * @category Net 39 | * @package PEAR2_Net_Transmitter 40 | * @author Vasil Rangelov 41 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 42 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 43 | */ 44 | class StreamException extends RuntimeException implements Exception 45 | { 46 | /** 47 | * @var int|string|resource|null The fragment up until the point of failure. 48 | * On failure with sending, this is the number of bytes sent 49 | * successfully before the failure. 50 | * On failure when receiving, this is a string/stream holding 51 | * the contents received successfully before the failure. 52 | * NULL if the failure occured before the operation started. 53 | */ 54 | protected $fragment = null; 55 | 56 | /** 57 | * Creates a new stream exception. 58 | * 59 | * @param string $message The Exception message to throw. 60 | * @param int $code The Exception code. 61 | * @param E|null $previous Previous exception thrown, 62 | * or NULL if there is none. 63 | * @param int|string|resource|null $fragment The fragment up until the 64 | * point of failure. 65 | * On failure with sending, this is the number of bytes sent 66 | * successfully before the failure. 67 | * On failure when receiving, this is a string/stream holding 68 | * the contents received successfully before the failure. 69 | * NULL if the failure occured before the operation started. 70 | */ 71 | public function __construct( 72 | $message, 73 | $code, 74 | E $previous = null, 75 | $fragment = null 76 | ) { 77 | parent::__construct($message, $code, $previous); 78 | $this->fragment = $fragment; 79 | } 80 | 81 | /** 82 | * Gets the stream fragment. 83 | * 84 | * @return int|string|resource|null The fragment up until the 85 | * point of failure. 86 | * On failure with sending, this is the number of bytes sent 87 | * successfully before the failure. 88 | * On failure when receiving, this is a string/stream holding 89 | * the contents received successfully before the failure. 90 | * NULL if the failure occured before the operation started. 91 | */ 92 | public function getFragment() 93 | { 94 | return $this->fragment; 95 | } 96 | 97 | // @codeCoverageIgnoreStart 98 | // Unreliable in testing. 99 | 100 | /** 101 | * Returns a string representation of the exception. 102 | * 103 | * @return string The exception as a string. 104 | */ 105 | public function __toString() 106 | { 107 | $result = parent::__toString(); 108 | if (null !== $this->fragment) { 109 | $result .= "\nFragment: "; 110 | if (is_scalar($this->fragment)) { 111 | $result .= (string)$this->fragment; 112 | } else { 113 | $result .= stream_get_contents($this->fragment); 114 | } 115 | } 116 | return $result; 117 | } 118 | // @codeCoverageIgnoreEnd 119 | } 120 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | There is an updated version of this project at: 2 | https://github.com/sonalsiby/EasyHotspot 3 | Please check that out as well. 4 | 5 | ----------------------------------------------------- 6 | Components/Packages/Scripts used in this project 7 | ------------------------------------------------- 8 | Elevator – Metro UI Inspired Free Bootstrap HTML5 Template by graygrids.com 9 | https://graygrids.com/item/elevator-metro-ui-inspired-responsive-bootstrap-template/ 10 | 11 | Twitter Bootstrap (& Jquery) http://getbootstrap.com/, https://jquery.com/ 12 | Font Awesome http://fontawesome.io/ 13 | 14 | Google Fonts http://fonts.googleapis.com/ 15 | 16 | Pear2 PHP API Client by boenrobot [Vasil Rangelov, a.k.a. boen_robot (boen [dot] robot [at] gmail [dot] com)] 17 | https://github.com/pear2/Net_RouterOS 18 | https://github.com/pear2/Net_RouterOS/wiki 19 | https://wiki.mikrotik.com/wiki/API_PHP_package 20 | http://pear2.php.net/support/ 21 | ------------------------------------------------- 22 | Developed by: Siby P Varkey, sibyperiyar@gmail.com 23 | Assistance: Sonal Siby, sonusiby@gmail.com 24 | ------------------------------------------------- 25 | Visual Documentation at : http://hotspot.zetozone.com 26 | ------------------------------------------------- 27 | Software and Hardware 28 | 29 | HTML, CSS, JavaScript, PHP, MySql, PDO, Javascript/Ajax, Font Awesome, JQuery, Twitter Bootstrap ... & PEAR2_Net_RouterOS API are the major software component parts of the utility. Above all the Mikrotik Router OS Based router or PC working with Router OS configured to an IP is the most important Hardware part involved. 30 | 31 | Requirements: Any web server supports PHP 5.x and all the above. 32 | ------------------------------------------------- 33 | Prerequisites 34 | A MySql database need to be created prior to operation, if it doesn't exist will be created automatically on initialization in most cases. 35 | 36 | The details of the database need to be updated in the file 'dbconfig.php' file before operation. (Host, DB name, DB Username and DB Password) 37 | 38 | The Details of the Router has to be entered in the 'config.php' file before operation, like Host IP, username and password. If they are not correct or the system is not able to connect to the Hotspot router, will ask for correct credentials in the first screen. 39 | ------------------------------------------------- 40 | System Users: Who are operating this utility. 41 | 3 User levels: Administrator, Unit Head and System users. 42 | Any number of users can be created by the system Admin. They can be enabled/disabled, edited, deleted and can reset the password also by the admin. A default system admin with username 'admin' and password 'admin' will be created automatically on initialisation. Admin user can reset passwords of all other users. On resetting a password, it will be reset to 'password' for that user. All users can change their own password using the change password option available in the system users section. 43 | ------------------------------------------------- 44 | Documentation and Help 45 | For more details of the operations and features of the utility please refer the visual documentation available at http://hotspot.zetozone.com 46 | ------------------------------------------------- 47 | Major features: 48 | 49 | Creation of vouchers for Single person. (Guest User Accounts/Hotspot users) 50 | Creation of vouchers for Multiple persons. 51 | Listing Active Users 52 | Listing inactive Users 53 | Remove Selected/All User Accounts 54 | Remove all validity expired User Accounts 55 | Server Log of Recent Activities 56 | Removal of uninitiated guest accounts. Accounts created earlier but no one has started using it yet. 57 | Voucher Management and Printing. 6 Different Voucher modes are available for Printing vouchers satisfying the needs of all. 58 | Management of System user Accounts by Admin: Creation, Listing, Activation/Deactivation, Updating details and deletion of System users. 59 | Hotspot User Profiles Management: Creation/Updation/Deletion of User profiles in the router. Options like Session Timeout, MAC binding of Account, Expiry mode, grace period, price, MAC Cookie Timeout, Keepalive Timeout, Download and Upload Speed Limits, Number of simultaneous user logins allowed per user account etc can be set for each profile. 60 | Re-printing of Last Voucher/Vouchers List. 61 | and many more... 62 | 63 | Please visit http://hotspot.zetozone.com for a detailed visual documentation of the project. 64 | ------------------------------------------------- 65 | How to Install in different OS based PCs 66 | Linux / Unix variations 67 | ................ 68 | .................. 69 | Windows Based PCs 70 | ................ 71 | .................. 72 | MAC OSX based MACs 73 | ................ 74 | .................. 75 | ................ 76 | .................. 77 | -------------------------------------------------------------------------------- /PEAR2/Console/Color/Styles.php: -------------------------------------------------------------------------------- 1 | 11 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 12 | * @version 1.0.0 13 | * @link http://pear2.php.net/PEAR2_Console_Color 14 | */ 15 | namespace PEAR2\Console\Color; 16 | 17 | use ReflectionClass; 18 | 19 | /** 20 | * This class has the possibles values to a Font Style. 21 | * 22 | * @category Console 23 | * @package PEAR2_Console_Color 24 | * @author Vasil Rangelov 25 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 26 | * @link http://pear2.php.net/PEAR2_Console_Color 27 | */ 28 | abstract class Styles 29 | { 30 | /** 31 | * Used in {@link \PEAR2\Console\Color::setStyles()} to match all styles. 32 | */ 33 | const ALL = null; 34 | 35 | /** 36 | * Used in {@link \PEAR2\Console\Color::setStyles()} as part of a bitmask. 37 | * If specified, matches the bold style. 38 | * When this style is enabled, the font is bolder. 39 | * With ANSICON, the font color becomes more intense (but not bolder). 40 | */ 41 | const BOLD = 1; 42 | 43 | /** 44 | * Used in {@link \PEAR2\Console\Color::setStyles()} as part of a bitmask. 45 | * If specified, matches the underline style. 46 | * When this style is enabled, the font is underlined. 47 | * With ANSICON, the background color becomes more intense 48 | * (and the font is not underlined), same as {@link self::BLINK}. 49 | */ 50 | const UNDERLINE = 2; 51 | 52 | /** 53 | * Used in {@link \PEAR2\Console\Color::setStyles()} as part of a bitmask. 54 | * If specified, matches the blink style. 55 | * When this style is enabled, the font color switches between its regular 56 | * color and the background color at regular (implementation defined) 57 | * intervals, creating the illusion of a blinking text. 58 | * With ANSICON, the background color becomes more intense 59 | * (and the font is not blinking), same as with {@link self::UNDERLINE}. 60 | */ 61 | const BLINK = 4; 62 | 63 | /** 64 | * Used in {@link \PEAR2\Console\Color::setStyles()} as part of a bitmask. 65 | * If specified, matches the concealed style. 66 | * When this style is enabled, the font color becomes the background color, 67 | * rendering the text invisible. This style is particularly useful for 68 | * implementations where simply setting the same color and background color 69 | * would not necesarily provide a fully invisibile text (e.g. ANSICON). 70 | */ 71 | const CONCEALED = 8; 72 | 73 | /** 74 | * @var (int[])[] An array describing the codes for the styles. 75 | * Each array key is the style's constant, and each value is an array 76 | * where the first member is the disable code, and the second is the 77 | * enable code. 78 | */ 79 | protected static $styleCodes = array( 80 | self::BOLD => array(22, 1), 81 | self::UNDERLINE => array(24, 4), 82 | self::BLINK => array(25, 5), 83 | self::CONCEALED => array(28, 8) 84 | ); 85 | 86 | /** 87 | * Get style constants. 88 | * 89 | * @param int|null $styles Bitmask of styles to match. 90 | * You can also use {@link self::ALL} (only) to get all styles. 91 | * 92 | * @return int[] Matching style constants. 93 | */ 94 | final public static function match($styles) 95 | { 96 | $flagsClass = new ReflectionClass(get_called_class()); 97 | $validStyles = array_values( 98 | array_unique($flagsClass->getConstants(), SORT_NUMERIC) 99 | ); 100 | unset($validStyles[array_search(self::ALL, $validStyles, true)]); 101 | 102 | if (self::ALL === $styles) { 103 | return $validStyles; 104 | } 105 | $styles = (int)$styles; 106 | 107 | $result = array(); 108 | foreach ($validStyles as $flag) { 109 | if ($styles & $flag) { 110 | $result[] = $flag; 111 | } 112 | } 113 | return $result; 114 | } 115 | 116 | /** 117 | * Gets the code for a style. 118 | * 119 | * @param int $style The style to get the code for. 120 | * @param bool $state The state to get code for. 121 | * TRUE for the enabled state codes, 122 | * FALSE for the disabled state codes. 123 | * 124 | * @return int The code for the flag specified. 125 | */ 126 | final public static function getCode($style, $state) 127 | { 128 | return static::$styleCodes[$style][(int)(bool)$state]; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /ajax_addusers.php: -------------------------------------------------------------------------------- 1 | = 1 and $_SESSION['user_level'] <= 3) { 52 | include('dbconfig.php'); 53 | $stmt = $DB_con->prepare("SELECT booking_id from hotspot_vouchers ORDER BY booking_id DESC LIMIT 1"); 54 | $stmt->execute(array()); 55 | $row = $stmt->fetch(PDO::FETCH_ASSOC); 56 | $booking_id = $row['booking_id']; 57 | $booking_id++; 58 | 59 | $stmt = $DB_con->prepare("UPDATE hotspot_vouchers set status=:status WHERE 1"); 60 | $stmt->execute(array(':status' => 'Over')); 61 | 62 | $stmt = $DB_con->prepare("insert into hotspot_vouchers (created_on, created_by, creator, user_name, password, printed_times, 63 | printed_last, status, group_of, booking_id, limit_uptime, limit_bytes, profile, uid) 64 | values(NOW(), :created_by, :creator, :user_name, :password, :printed_times, :printed_last, :status, :group_of, 65 | :booking_id, :limit_uptime, :limit_bytes, :profile, :uid)"); 66 | 67 | $k = 1; 68 | for($i=0; $i < $no_of_users; $i++){ 69 | //$passAlphabet = 'abcdefghikmnpqrstuvxyz23456789'; 70 | //$passAlphabetLimit = strlen($passAlphabet)-1; 71 | $pass = ''; 72 | $uid = ''; 73 | //Password generation 74 | for ($j = 0; $j < $passLength; ++$j) { 75 | $pass .= $passAlphabet[mt_rand(0, $passAlphabetLimit)]; 76 | } 77 | $pass = str_shuffle($pass); 78 | //Username generation 79 | for ($j = 0; $j < $passLength; ++$j) { 80 | $uid .= $passAlphabet[mt_rand(0, $passAlphabetLimit)]; 81 | } 82 | //Adding prefix to username 83 | $user_name = $user_prefix.$uid; 84 | 85 | //username & password same or different 86 | if ($same_pass == 2) { $pass_word = $pass; } else { $pass_word = $user_name; } 87 | 88 | $util->setMenu('/ip hotspot user'); 89 | $iv = count($util); 90 | 91 | if (intval($limit_bytes) != 0) { 92 | $limit_bytes_total = (intval($limit_bytes) * 1024 * 1024 * 1024 ); 93 | $util->add( 94 | array( 95 | 'name' => "$username", 96 | 'password' => "$password", 97 | 'disabled' => "no", 98 | 'limit-uptime' => "$limit_uptime", 99 | 'limit-bytes-total' => "$limit_bytes_total", 100 | 'profile' => "$profile", 101 | 'comment' => "Zetozone", 102 | ) 103 | ); 104 | } 105 | else 106 | { 107 | $util->add( 108 | array( 109 | 'name' => "$username", 110 | 'password' => "$password", 111 | 'disabled' => "no", 112 | 'limit-uptime' => "$limit_uptime", 113 | 'profile' => "$profile", 114 | 'comment' => "Zetozone", 115 | ) 116 | ); 117 | $limit_bytes = 0; // For Adding it to Local database 118 | } 119 | 120 | if ($iv != count($util)) { 121 | $uid = $booking_id.'-'.$k.'-'.$no_of_users.date('dmY'); 122 | //$creator = $_SESSION['username'].'['.$_SESSION['id'].']'; 123 | $stmt->execute(array(':created_by' => $_SESSION['username'], ':creator' => $_SESSION['id'], ':user_name' => $user_name, ':password' => $pass_word, 124 | ':printed_times' => 0, ':printed_last' => '', ':status' => 'Active', ':group_of' => $no_of_users, 125 | ':booking_id' => $booking_id, ':limit_uptime' => $limit_uptime, ':limit_bytes' => $limit_bytes, 126 | ':profile' => $profile, ':uid' => $uid)); 127 | $k++; 128 | } 129 | } 130 | echo $k - 1; //Successful 131 | } 132 | else 133 | { 134 | echo 0; // Not an Authorised User 135 | } 136 | ?> -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/TcpServerConnection.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | use Exception as E; 26 | 27 | /** 28 | * A transmitter for connections to a socket server. 29 | * 30 | * This is a convinience wrapper for functionality of socket server connections. 31 | * Used to ensure data integrity. Server handling is not part of the class in 32 | * order to allow its usage as part of various server implementations (e.g. fork 33 | * and/or sequential). 34 | * 35 | * @category Net 36 | * @package PEAR2_Net_Transmitter 37 | * @author Vasil Rangelov 38 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 39 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 40 | */ 41 | class TcpServerConnection extends NetworkStream 42 | { 43 | 44 | /** 45 | * @var string The IP address of the connected client. 46 | */ 47 | protected $peerIP; 48 | 49 | /** 50 | * @var int The port of the connected client. 51 | */ 52 | protected $peerPort; 53 | 54 | /** 55 | * Creates a new connection with the specified options. 56 | * 57 | * @param resource $server A socket server, created with 58 | * {@link stream_socket_server()}. 59 | * @param float $timeout The timeout for the connection. 60 | */ 61 | public function __construct($server, $timeout = null) 62 | { 63 | $this->streamType = '_SERVER'; 64 | 65 | if (!self::isStream($server)) { 66 | throw $this->createException('Invalid server supplied.', 9); 67 | } 68 | $timeout 69 | = null == $timeout ? ini_get('default_socket_timeout') : $timeout; 70 | 71 | set_error_handler(array($this, 'handleError')); 72 | try { 73 | parent::__construct( 74 | stream_socket_accept($server, $timeout, $peername) 75 | ); 76 | restore_error_handler(); 77 | $portString = strrchr($peername, ':'); 78 | $this->peerPort = (int) substr($portString, 1); 79 | $ipString = substr( 80 | $peername, 81 | 0, 82 | strlen($peername) - strlen($portString) 83 | ); 84 | if (strpos($ipString, '[') === 0 85 | && strpos(strrev($ipString), ']') === 0 86 | ) { 87 | $ipString = substr($ipString, 1, strlen($ipString) - 2); 88 | } 89 | $this->peerIP = $ipString; 90 | } catch (E $e) { 91 | restore_error_handler(); 92 | throw $this->createException( 93 | 'Failed to initialize connection.', 94 | 10, 95 | $e 96 | ); 97 | } 98 | } 99 | 100 | /** 101 | * Gets the IP address of the connected client. 102 | * 103 | * @return string The IP address of the connected client. 104 | */ 105 | public function getPeerIP() 106 | { 107 | return $this->peerIP; 108 | } 109 | 110 | /** 111 | * Gets the port of the connected client. 112 | * 113 | * @return int The port of the connected client. 114 | */ 115 | public function getPeerPort() 116 | { 117 | return $this->peerPort; 118 | } 119 | 120 | /** 121 | * Creates a new exception. 122 | * 123 | * Creates a new exception. Used by the rest of the functions in this class. 124 | * 125 | * @param string $message The exception message. 126 | * @param int $code The exception code. 127 | * @param E|null $previous Previous exception thrown, or NULL if there 128 | * is none. 129 | * @param string|null $fragment The fragment up until the point of failure. 130 | * NULL if the failure occured before the operation started. 131 | * 132 | * @return SocketException The exception to then be thrown. 133 | */ 134 | protected function createException( 135 | $message, 136 | $code = 0, 137 | E $previous = null, 138 | $fragment = null 139 | ) { 140 | return new SocketException( 141 | $message, 142 | $code, 143 | $previous, 144 | $fragment 145 | ); 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /hotsoft.php: -------------------------------------------------------------------------------- 1 | setMenu('/ip hotspot user'); 39 | $iv = count($util); 40 | 41 | if ((intval($limit_bytes) != 0) and (!empty($limit_uptime))) { 42 | $limit_bytes_total = (intval($limit_bytes) * 1024 * 1024 * 1024 ); 43 | $util->add( 44 | array( 45 | 'name' => "$username", 46 | 'password' => "$password", 47 | 'limit-uptime' => "$limit_uptime", 48 | 'limit-bytes-total' => "$limit_bytes_total", 49 | 'profile' => "$profile" 50 | ) 51 | ); 52 | } 53 | elseif (intval($limit_bytes) != 0) { 54 | $limit_bytes_total = (intval($limit_bytes) * 1024 * 1024 * 1024 ); 55 | $util->add( 56 | array( 57 | 'name' => "$username", 58 | 'password' => "$password", 59 | 'limit-bytes-total' => "$limit_bytes_total", 60 | 'profile' => "$profile" 61 | ) 62 | ); 63 | } 64 | else 65 | { 66 | $util->add( 67 | array( 68 | 'name' => "$username", 69 | 'password' => "$password", 70 | 'limit-uptime' => "$limit_uptime", 71 | 'profile' => "$profile" 72 | ) 73 | ); 74 | $limit_bytes = 0; // For Adding it to Local database 75 | } 76 | 77 | if ($iv != count($util)) { 78 | include('dbconfig.php'); 79 | $stmt = $DB_con->prepare("SELECT booking_id from hotspot_vouchers ORDER BY booking_id DESC LIMIT 1"); 80 | $stmt->execute(array()); 81 | $row = $stmt->fetch(PDO::FETCH_ASSOC); 82 | $booking_id = $row['booking_id']; 83 | $booking_id++; 84 | $uid = $booking_id.'-1-'.date('dmY'); 85 | $creator = 999; 86 | $created_by = 'Hotsoft'; 87 | $stmt = $DB_con->prepare("UPDATE hotspot_vouchers set status=:status WHERE 1"); 88 | $stmt->execute(array(':status' => 'Over')); 89 | $stmt = $DB_con->prepare("insert into hotspot_vouchers (created_on, created_by, creator, user_name, password, printed_times, 90 | printed_last, status, group_of, booking_id, limit_uptime, limit_bytes, profile, uid) 91 | values(NOW(), :created_by, :creator, :user_name, :password, :printed_times, :printed_last, :status, :group_of, 92 | :booking_id, :limit_uptime, :limit_bytes, :profile, :uid)"); 93 | $stmt->execute(array(':created_by' => $created_by, ':creator' => $creator, ':user_name' => $username, ':password' => $password, 94 | ':printed_times' => 0, ':printed_last' => '', ':status' => 'Active', ':group_of' => 1, 95 | ':booking_id' => $booking_id, ':limit_uptime' => $limit_uptime, ':limit_bytes' => $limit_bytes, 96 | ':profile' => $profile, ':uid' => $uid)); 97 | echo 0; //Success 98 | } 99 | else 100 | { 101 | echo 3; // Duplicate/Existing username 102 | } 103 | } 104 | else 105 | { 106 | echo 2; //Blank Username 107 | } 108 | //End Adding a Guest User 109 | } 110 | elseif (strtolower($action) == 'checkout')) { 111 | //Removal 112 | $username=trim($_GET['username']); 113 | if (!empty($username)) { 114 | $printRequest = new RouterOS\Request('/ip/hotspot/user/print'); 115 | $printRequest->setArgument('.proplist', '.id,name'); 116 | $printRequest->setQuery(RouterOS\Query::where('name', $username)); 117 | $id = $client->sendSync($printRequest)->getProperty('.id'); 118 | 119 | $removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); 120 | $removeRequest->setArgument('numbers', $id); 121 | $client->sendSync($removeRequest); 122 | echo 0; //Success 123 | } 124 | else 125 | { 126 | echo 2; //Blank Username 127 | } 128 | } 129 | else 130 | { 131 | echo 1; //Wrong Action Verb 132 | } 133 | ?> -------------------------------------------------------------------------------- /PEAR2/Console/CommandLine/MessageProvider/Default.php: -------------------------------------------------------------------------------- 1 | 17 | * @copyright 2007-2009 David JEAN LOUIS 18 | * @license http://opensource.org/licenses/mit-license.php MIT License 19 | * @version 0.2.1 20 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 21 | * @since File available since release 0.1.0 22 | * @filesource 23 | */ 24 | 25 | namespace PEAR2\Console\CommandLine; 26 | 27 | /** 28 | * Lightweight class that manages messages used by PEAR2\Console\CommandLine package, 29 | * allowing the developper to customize these messages, for example to 30 | * internationalize a command line frontend. 31 | * 32 | * @category Console 33 | * @package PEAR2\Console\CommandLine 34 | * @author David JEAN LOUIS 35 | * @copyright 2007-2009 David JEAN LOUIS 36 | * @license http://opensource.org/licenses/mit-license.php MIT License 37 | * @link http://pear2.php.net/PEAR2_Console_CommandLine 38 | * @since Class available since release 0.1.0 39 | */ 40 | class MessageProvider_Default 41 | implements MessageProvider, 42 | CustomMessageProvider 43 | { 44 | // Properties {{{ 45 | 46 | /** 47 | * Associative array of messages 48 | * 49 | * @var array $messages 50 | */ 51 | protected $messages = array( 52 | 'OPTION_VALUE_REQUIRED' => 'Option "{$name}" requires a value.', 53 | 'OPTION_VALUE_UNEXPECTED' => 'Option "{$name}" does not expect a value (got "{$value}").', 54 | 'OPTION_VALUE_NOT_VALID' => 'Option "{$name}" must be one of the following: "{$choices}" (got "{$value}").', 55 | 'OPTION_VALUE_TYPE_ERROR' => 'Option "{$name}" requires a value of type {$type} (got "{$value}").', 56 | 'OPTION_AMBIGUOUS' => 'Ambiguous option "{$name}", can be one of the following: {$matches}.', 57 | 'OPTION_UNKNOWN' => 'Unknown option "{$name}".', 58 | 'ARGUMENT_REQUIRED' => 'You must provide at least {$argnum} argument{$plural}.', 59 | 'PROG_HELP_LINE' => 'Type "{$progname} --help" to get help.', 60 | 'PROG_VERSION_LINE' => '{$progname} version {$version}.', 61 | 'COMMAND_HELP_LINE' => 'Type "{$progname} --help" to get help on specific command.', 62 | 'USAGE_WORD' => 'Usage', 63 | 'OPTION_WORD' => 'Options', 64 | 'ARGUMENT_WORD' => 'Arguments', 65 | 'COMMAND_WORD' => 'Commands', 66 | 'PASSWORD_PROMPT' => 'Password: ', 67 | 'PASSWORD_PROMPT_ECHO' => 'Password (warning: will echo): ', 68 | 'INVALID_CUSTOM_INSTANCE' => 'Instance does not implement the required interface', 69 | 'LIST_OPTION_MESSAGE' => 'lists valid choices for option {$name}', 70 | 'LIST_DISPLAYED_MESSAGE' => 'Valid choices are: ', 71 | 'INVALID_SUBCOMMAND' => 'Command "{$command}" is not valid.', 72 | 'SUBCOMMAND_REQUIRED' => 'Please enter one of the following command: {$commands}.', 73 | ); 74 | 75 | // }}} 76 | // get() {{{ 77 | 78 | /** 79 | * Retrieve the given string identifier corresponding message. 80 | * 81 | * @param string $code The string identifier of the message 82 | * @param array $vars An array of template variables 83 | * 84 | * @return string 85 | */ 86 | public function get($code, $vars = array()) 87 | { 88 | if (!isset($this->messages[$code])) { 89 | return 'UNKNOWN'; 90 | } 91 | return $this->replaceTemplateVars($this->messages[$code], $vars); 92 | } 93 | 94 | // }}} 95 | // getWithCustomMessages() {{{ 96 | 97 | /** 98 | * Retrieve the given string identifier corresponding message. 99 | * 100 | * @param string $code The string identifier of the message 101 | * @param array $vars An array of template variables 102 | * @param array $messages An optional array of messages to use. Array 103 | * indexes are message codes. 104 | * 105 | * @return string 106 | */ 107 | public function getWithCustomMessages( 108 | $code, $vars = array(), $messages = array() 109 | ) { 110 | // get message 111 | if (isset($messages[$code])) { 112 | $message = $messages[$code]; 113 | } elseif (isset($this->messages[$code])) { 114 | $message = $this->messages[$code]; 115 | } else { 116 | $message = 'UNKNOWN'; 117 | } 118 | return $this->replaceTemplateVars($message, $vars); 119 | } 120 | 121 | // }}} 122 | // replaceTemplateVars() {{{ 123 | 124 | /** 125 | * Replaces template vars in a message 126 | * 127 | * @param string $message The message 128 | * @param array $vars An array of template variables 129 | * 130 | * @return string 131 | */ 132 | protected function replaceTemplateVars($message, $vars = array()) 133 | { 134 | $tmpkeys = array_keys($vars); 135 | $keys = array(); 136 | foreach ($tmpkeys as $key) { 137 | $keys[] = '{$' . $key . '}'; 138 | } 139 | return str_replace($keys, array_values($vars), $message); 140 | } 141 | 142 | // }}} 143 | } 144 | -------------------------------------------------------------------------------- /ajax_adduser.php: -------------------------------------------------------------------------------- 1 | setMenu('/ip hotspot user'); 17 | $iv = count($util); 18 | 19 | if ((!empty($username)) and (!empty($password)) and (!empty($profile))) { 20 | if (intval($limit_bytes) != 0) { 21 | $limit_bytes_total = (intval($limit_bytes) * 1024 * 1024 * 1024 ); 22 | $util->add( 23 | array( 24 | 'name' => "$username", 25 | 'password' => "$password", 26 | 'disabled' => "no", 27 | 'limit-uptime' => "$limit_uptime", 28 | 'limit-bytes-total' => "$limit_bytes_total", 29 | 'profile' => "$profile", 30 | 'comment' => "Zetozone", 31 | ) 32 | ); 33 | } 34 | else 35 | { 36 | $util->add( 37 | array( 38 | 'name' => "$username", 39 | 'password' => "$password", 40 | 'disabled' => "no", 41 | 'limit-uptime' => "$limit_uptime", 42 | 'profile' => "$profile", 43 | 'comment' => "Zetozone", 44 | ) 45 | ); 46 | $limit_bytes = 0; // For Adding it to Local database 47 | } 48 | 49 | if ($iv != count($util)) { 50 | include('dbconfig.php'); 51 | $stmt = $DB_con->prepare("SELECT booking_id from hotspot_vouchers ORDER BY booking_id DESC LIMIT 1"); 52 | $stmt->execute(array()); 53 | $row = $stmt->fetch(PDO::FETCH_ASSOC); 54 | $booking_id = $row['booking_id']; 55 | $booking_id++; 56 | $uid = $booking_id.'-1-'.date('dmY'); 57 | //$creator = $_SESSION['username'].'['.$_SESSION['id'].']'; 58 | $stmt = $DB_con->prepare("UPDATE hotspot_vouchers set status=:status WHERE 1"); 59 | $stmt->execute(array(':status' => 'Over')); 60 | $stmt = $DB_con->prepare("insert into hotspot_vouchers (created_on, created_by, creator, user_name, password, printed_times, 61 | printed_last, status, group_of, booking_id, limit_uptime, limit_bytes, profile, uid) 62 | values(NOW(), :created_by, :creator, :user_name, :password, :printed_times, :printed_last, :status, :group_of, 63 | :booking_id, :limit_uptime, :limit_bytes, :profile, :uid)"); 64 | $stmt->execute(array(':created_by' => $_SESSION['username'], ':creator' => $_SESSION['id'], ':user_name' => $username, ':password' => $password, 65 | ':printed_times' => 0, ':printed_last' => '', ':status' => 'Active', ':group_of' => 1, 66 | ':booking_id' => $booking_id, ':limit_uptime' => $limit_uptime, ':limit_bytes' => $limit_bytes, 67 | ':profile' => $profile, ':uid' => $uid)); 68 | 69 | // here starts Echo String 70 | $echo_text =' 71 |
72 |
73 |
74 |
75 |

Hotspot User Voucher

76 |
77 |
78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | '; 88 | $echo_text .= ' 89 | 90 | 91 | 92 | 93 | '; 94 | if (intval($limit_bytes) != 0) { 95 | $echo_text .= ''; 96 | } 97 | else 98 | { 99 | $echo_text .= ''; 100 | } 101 | $echo_text .= ' 102 | 103 | 104 |
UsernamePassword
Validity : '.$limit_uptime.'ays; Counts from First login; Data usage Maximum : '.$limit_bytes_total.' Bytes; Bandwidth : '.$profile.'; HAPPY BROWSING...Validity : '.$limit_uptime.'ays; Counts from First login; Bandwidth/Profile : '.$profile.'; HAPPY BROWSING...
105 |
106 |
107 |
108 |
109 |
110 |
111 |    112 |    113 |    114 |
115 |
116 |
'; 117 | echo $echo_text; 118 | } 119 | else 120 | { 121 | echo ''; 122 | } 123 | } 124 | //End Adding a Guest User 125 | ?> -------------------------------------------------------------------------------- /ajax_add_profile.php: -------------------------------------------------------------------------------- 1 | setMenu('/ip hotspot user profile'); 59 | if(strtolower($session_timeout) == 'none') $session_timeout = '00:00:00'; 60 | $util->add( 61 | array( 62 | 'name' => "$profile_name", 63 | 'rate-limit' => "$rate_limit", 64 | 'shared-users' => "$shared_users", 65 | 'status-autorefresh' => "1m", 66 | 'transparent-proxy' => "yes", 67 | 'on-login' => "$login_script", 68 | ) 69 | ); 70 | /* Old version 71 | array( 72 | 'name' => "$profile_name", 73 | 'rate-limit' => "$rate_limit", 74 | 'session-timeout' => "$session_timeout", 75 | 'shared-users' => "$shared_users", 76 | 'mac-cookie-timeout' => "$mac_cookie_timeout", 77 | 'keepalive-timeout' => "$keepalive_timeout", 78 | 'status-autorefresh' => "1m", 79 | 'transparent-proxy' => "yes", 80 | 'on-login' => "$login_script", 81 | ) 82 | */ 83 | /* 84 | if(strtolower($session_timeout) == 'none') { 85 | $id = $client->sendSync(new Request('/ip/hotspot/user/profile/print .proplist=.id', null, Query::where('name', $profile_name)))->getArgument('.id'); 86 | $util->setMenu('/ip hotspot user profile'); 87 | $util->unsetValue($id, 'session-timeout'); 88 | } */ 89 | echo 2; //Success 90 | } 91 | else 92 | { 93 | echo 1; //Profile name/Session Timeout Empty 94 | } 95 | } 96 | else 97 | { 98 | echo 0; //Not Authorised 99 | } 100 | ?> -------------------------------------------------------------------------------- /PEAR2/Net/Transmitter/NetworkStream.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2011 Vasil Rangelov 16 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 17 | * @version 1.0.0a5 18 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 19 | */ 20 | /** 21 | * The namespace declaration. 22 | */ 23 | namespace PEAR2\Net\Transmitter; 24 | 25 | /** 26 | * A network transmitter. 27 | * 28 | * This is a convinience wrapper for network streams. Used to ensure data 29 | * integrity. 30 | * 31 | * @category Net 32 | * @package PEAR2_Net_Transmitter 33 | * @author Vasil Rangelov 34 | * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 35 | * @link http://pear2.php.net/PEAR2_Net_Transmitter 36 | */ 37 | abstract class NetworkStream extends Stream 38 | { 39 | /** 40 | * Used in {@link setCrypto()} to disable encryption. 41 | */ 42 | const CRYPTO_OFF = ''; 43 | 44 | /** 45 | * Used in {@link setCrypto()} to set encryption to either SSLv2 or SSLv3, 46 | * depending on what the other end supports. 47 | */ 48 | const CRYPTO_SSL = 'SSLv23'; 49 | 50 | /** 51 | * Used in {@link setCrypto()} to set encryption to SSLv2. 52 | */ 53 | const CRYPTO_SSL2 = 'SSLv2'; 54 | 55 | /** 56 | * Used in {@link setCrypto()} to set encryption to SSLv3. 57 | */ 58 | const CRYPTO_SSL3 = 'SSLv3'; 59 | 60 | /** 61 | * Used in {@link setCrypto()} to set encryption to TLS (exact version 62 | * negotiated between 1.0 and 1.2). 63 | */ 64 | const CRYPTO_TLS = 'TLS'; 65 | 66 | /** 67 | * @var string The type of stream. Can be either "_CLIENT" or "_SERVER". 68 | * Used to complement the encryption type. Must be set by child classes 69 | * for {@link setCrypto()} to work properly. 70 | */ 71 | protected $streamType = ''; 72 | 73 | /** 74 | * @var string The current cryptography setting. 75 | */ 76 | protected $crypto = ''; 77 | 78 | /** 79 | * Wraps around the specified stream. 80 | * 81 | * @param resource $stream The stream to wrap around. 82 | */ 83 | public function __construct($stream) 84 | { 85 | parent::__construct($stream, true); 86 | } 87 | 88 | /** 89 | * Gets the current cryptography setting. 90 | * 91 | * @return string One of this class' CRYPTO_* constants. 92 | */ 93 | public function getCrypto() 94 | { 95 | return $this->crypto; 96 | } 97 | 98 | /** 99 | * Sets the current connection's cryptography setting. 100 | * 101 | * @param string $type The encryption type to set. Must be one of this 102 | * class' CRYPTO_* constants. 103 | * 104 | * @return boolean TRUE on success, FALSE on failure. 105 | */ 106 | public function setCrypto($type) 107 | { 108 | if (self::CRYPTO_OFF === $type) { 109 | $result = stream_socket_enable_crypto($this->stream, false); 110 | } else { 111 | $result = stream_socket_enable_crypto( 112 | $this->stream, 113 | true, 114 | constant("STREAM_CRYPTO_METHOD_{$type}{$this->streamType}") 115 | ); 116 | } 117 | 118 | if ($result) { 119 | $this->crypto = $type; 120 | } 121 | return $result; 122 | } 123 | 124 | /** 125 | * Checks whether the stream is available for operations. 126 | * 127 | * @return bool TRUE if the stream is available, FALSE otherwise. 128 | */ 129 | public function isAvailable() 130 | { 131 | if (parent::isStream($this->stream)) { 132 | if ($this->isBlocking && feof($this->stream)) { 133 | return false; 134 | } 135 | $meta = stream_get_meta_data($this->stream); 136 | return !$meta['eof']; 137 | } 138 | return false; 139 | } 140 | 141 | /** 142 | * Sets the size of a stream's buffer. 143 | * 144 | * @param int $size The desired size of the buffer, in bytes. 145 | * @param string $direction The buffer of which direction to set. Valid 146 | * values are the DIRECTION_* constants. 147 | * 148 | * @return bool TRUE on success, FALSE on failure. 149 | */ 150 | public function setBuffer($size, $direction = self::DIRECTION_ALL) 151 | { 152 | $result = parent::setBuffer($size, $direction); 153 | if (self::DIRECTION_SEND === $direction 154 | && function_exists('stream_set_chunk_size') && !$result 155 | ) { 156 | return false !== @stream_set_chunk_size($this->stream, $size); 157 | } 158 | return $result; 159 | } 160 | 161 | /** 162 | * Shutdown a full-duplex connection 163 | * 164 | * Shutdowns (partially or not) a full-duplex connection. 165 | * 166 | * @param string $direction The direction for which to disable further 167 | * communications. 168 | * 169 | * @return bool TRUE on success, FALSE on failure. 170 | */ 171 | public function shutdown($direction = self::DIRECTION_ALL) 172 | { 173 | $directionMap = array( 174 | self::DIRECTION_ALL => STREAM_SHUT_RDWR, 175 | self::DIRECTION_SEND => STREAM_SHUT_WR, 176 | self::DIRECTION_RECEIVE => STREAM_SHUT_RD 177 | ); 178 | return array_key_exists($direction, $directionMap) 179 | && stream_socket_shutdown($this->stream, $directionMap[$direction]); 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /ajax_edit_profile.php: -------------------------------------------------------------------------------- 1 | setArgument('.proplist', '.id'); 63 | $printRequest->setQuery(RouterOS\Query::where('name', $profile_name)); 64 | $id = $client->sendSync($printRequest)->getProperty('.id'); 65 | 66 | $setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set'); 67 | $setRequest->setArgument('numbers', $id); 68 | $setRequest->setArgument('rate-limit', $rate_limit); 69 | /* 70 | if(strtolower($session_timeout) != 'none') { 71 | $setRequest->setArgument('session-timeout', $session_timeout); 72 | } 73 | else 74 | { 75 | $setRequest->setArgument('session-timeout', '00:00:00'); 76 | } 77 | $setRequest->setArgument('mac-cookie-timeout', $mac_cookie_timeout); 78 | $setRequest->setArgument('keepalive-timeout', $keepalive_timeout); 79 | */ 80 | $setRequest->setArgument('shared-users', $shared_users); 81 | $setRequest->setArgument('status-autorefresh', "1m"); 82 | $setRequest->setArgument('transparent-proxy', "yes"); 83 | $setRequest->setArgument('on-login', "$login_script"); 84 | 85 | $client->sendSync($setRequest); 86 | /* 87 | if(strtolower($session_timeout) == 'none') { 88 | $id = $client->sendSync(new Request('/ip/hotspot/user/profile/print .proplist=.id', null, Query::where('name', $profile_name)))->getArgument('.id'); 89 | $util->setMenu('/ip hotspot user profile'); 90 | $util->unsetValue($id, 'session-timeout'); 91 | } */ 92 | echo 2; //Success 93 | } 94 | else 95 | { 96 | echo 1; //Profile name Improper 97 | } 98 | } 99 | else 100 | { 101 | echo 0; //Not Authorised 102 | } 103 | ?> -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,700,600); 2 | @import url(http://fonts.googleapis.com/css?family=Oswald:400,300); 3 | 4 | body { 5 | background: url(../images/bg.jpg); 6 | background-attachment: fixed; 7 | background-size: cover; 8 | background-position: 50% 50%; 9 | font-family: 'Open Sans', sans-serif; 10 | } 11 | 12 | a, 13 | a:hover, 14 | a:focus, 15 | a:active, 16 | a.active { 17 | outline: 0; 18 | } 19 | 20 | ul,ol { 21 | margin: 0; 22 | padding: 0; 23 | } 24 | 25 | li { 26 | list-style: none; 27 | } 28 | 29 | a { 30 | color: #FF432E; 31 | text-decoration: none; 32 | } 33 | 34 | a:hover { 35 | text-decoration: none; 36 | } 37 | 38 | p { 39 | font-family: 'Open Sans', sans-serif; 40 | font-size: 13px; 41 | line-height: 21px; 42 | } 43 | 44 | /**** Start Logo Section ****/ 45 | 46 | #logo-section { 47 | 48 | } 49 | 50 | .logo h1 { 51 | font-family: 'Lobster', cursive; 52 | color: #fff; 53 | font-size: 60px; 54 | } 55 | 56 | .logo span { 57 | color: #999; 58 | } 59 | 60 | 61 | 62 | /**** Start Background Color ****/ 63 | 64 | .blue { 65 | background: #28ABE3; 66 | } 67 | 68 | .green { 69 | background: #72bf48; 70 | } 71 | 72 | .red { 73 | background: #FF432E; 74 | } 75 | 76 | .olive { 77 | background: #808000; 78 | } 79 | 80 | .purple { 81 | background: #800080; 82 | } 83 | .fuchsia { 84 | background: #FF00FF; 85 | } 86 | .navy { 87 | background: #000080; 88 | } 89 | .bisque { 90 | background: #FFE4C4; 91 | } 92 | .gold { 93 | background: #FFD700; 94 | } 95 | .skyblue { 96 | background: #87CEEB; 97 | } 98 | .lavender { 99 | background: #E6E6FA; 100 | } 101 | .coral { 102 | background: #FB7F50; /* wrong code for color */ 103 | } 104 | 105 | 106 | /**** Start Main Body Section ****/ 107 | .mainbody-section { 108 | padding-top: 50px; 109 | padding-bottom: 30px; 110 | } 111 | 112 | .menu-item { 113 | color: #fff; 114 | padding-top: 20px; 115 | padding-bottom: 20px; 116 | margin-bottom: 30px; 117 | -webkit-transition: all 0.3s; 118 | transition: all 0.3s; 119 | 120 | } 121 | 122 | .menu-item a { 123 | color: #fff; 124 | display: block; 125 | -webkit-transition: all 0.3s; 126 | transition: all 0.3s; 127 | } 128 | 129 | .menu-item a p { 130 | font-family: 'Oswald', sans-serif; 131 | font-weight: 300; 132 | font-size: 20px; 133 | } 134 | 135 | .menu-item a i { 136 | font-size: 50px; 137 | padding-bottom: 20px; 138 | } 139 | 140 | .menu-item:hover a { 141 | text-decoration: none; 142 | //color: #333; 143 | animation: wobble; 144 | -webkit-animation: wobble; 145 | animation-duration: 1000ms; 146 | -webkit-animation-duration: 1000ms; 147 | } 148 | 149 | @media only screen 150 | and (min-width : 600px) 151 | and (max-width : 991px) { 152 | 153 | .menu-item { 154 | display: inline-block; 155 | width: 32.8%; 156 | } 157 | 158 | .menu-item.responsive { 159 | width: 49.5%; 160 | float: left; 161 | margin-right: 3px; 162 | } 163 | 164 | .menu-item.responsive-2 { 165 | width: 49.5%; 166 | float: right; 167 | } 168 | 169 | } 170 | 171 | @media only screen 172 | and (min-width : 992px) 173 | and (max-width : 1199px) { 174 | 175 | .menu-item { 176 | padding-top: 15px; 177 | padding-bottom: 15px; 178 | } 179 | 180 | .menu-item a i { 181 | font-size: 32px; 182 | } 183 | 184 | .menu-item a p { 185 | font-size: 16px; 186 | } 187 | 188 | } 189 | 190 | /**** Start Modal Section ****/ 191 | 192 | .modal-content { 193 | overflow:visible !important; 194 | } 195 | .child-modal .modal-content { 196 | padding: 50px 0 !important; 197 | margin-top: 120px !important; 198 | margin-right: 20px !important; 199 | margin-left: 20px !important; 200 | margin-bottom: 80px !important; 201 | min-height: auto !important; 202 | border: 2 !important; 203 | border-radius: 6 !important; 204 | background-clip: border-box; 205 | -webkit-box-shadow: none !important; 206 | -moz-box-shadow: none !important; 207 | box-shadow: 10px 10px 5px 3px #888888 !important; 208 | font-weight: 200; 209 | color: #666 !important; 210 | font-family: 'Oswald', sans-serif; 211 | text-transform: none; 212 | } 213 | 214 | .modal-footer { 215 | padding: 1px !important; 216 | } 217 | 218 | table#table-01 { 219 | width:100%; 220 | border-radius: 10 !important; 221 | border-spacing: 5px !important; 222 | } 223 | table, th, td { 224 | border: 1px solid black; 225 | border-collapse: collapse; 226 | border-spacing: 5px !important; 227 | } 228 | th, td { 229 | padding: 5px; 230 | text-align: left; 231 | } 232 | table#table-01 tr:nth-child(even) { 233 | background-color: #eee; 234 | } 235 | table#table-01 tr:nth-child(odd) { 236 | background-color:#fff; 237 | } 238 | table#table-01 th { 239 | background-color: black; 240 | color: white; 241 | } 242 | .card-columns { 243 | 244 | @include media-breakpoint-only(lg) { 245 | column-count: 4; 246 | } 247 | @include media-breakpoint-only(xl) { 248 | column-count: 5; 249 | } 250 | @include media-breakpoint-only(sm) { 251 | column-count: 3; 252 | } 253 | @include media-breakpoint-only(xs) { 254 | column-count: 3; 255 | } 256 | } 257 | img.center { 258 | display: block; 259 | margin: 0 auto; 260 | } 261 | .center-element { 262 | width: 100%; 263 | margin: 0px auto 0px auto; 264 | } 265 | /* 266 | @media print { 267 | *, 268 | *:before,enter code here 269 | *:after { 270 | color: #000 !important; 271 | text-shadow: none !important; 272 | background: transparent !important; 273 | -webkit-box-shadow: none !important; 274 | box-shadow: none !important; 275 | } 276 | a, 277 | a:visited { 278 | text-decoration: underline; 279 | } 280 | a[href]:after { 281 | content: " (" attr(href) ")"; 282 | } 283 | abbr[title]:after { 284 | content: " (" attr(title) ")"; 285 | } 286 | a[href^="#"]:after, 287 | a[href^="javascript:"]:after { 288 | content: ""; 289 | } 290 | pre, 291 | blockquote { 292 | border: 1px solid #999; 293 | 294 | page-break-inside: avoid; 295 | } 296 | thead { 297 | display: table-header-group; 298 | } 299 | tr, 300 | img { 301 | page-break-inside: avoid; 302 | } 303 | img { 304 | max-width: 100% !important; 305 | } 306 | p, 307 | h2, 308 | h3 { 309 | orphans: 3; 310 | widows: 3; 311 | } 312 | h2, 313 | h3 { 314 | page-break-after: avoid; 315 | } 316 | select { 317 | background: #fff !important; 318 | } 319 | .navbar { 320 | display: none; 321 | } 322 | .btn > .caret, 323 | .dropup > .btn > .caret { 324 | border-top-color: #000 !important; 325 | } 326 | .label { 327 | border: 1px solid #000; 328 | } 329 | .table { 330 | border-collapse: collapse !important; 331 | } 332 | .table td, 333 | .table th { 334 | background-color: #fff !important; 335 | } 336 | .table-bordered th, 337 | .table-bordered td { 338 | border: 1px solid #ddd !important; 339 | } 340 | } 341 | */ --------------------------------------------------------------------------------