forked from kevinowino869/mitrobill
sha1
This commit is contained in:
parent
a2bd40f443
commit
5682aeb0b1
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
|
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
|
||||||
|
|
||||||
@ -8,27 +9,31 @@
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
Class Password{
|
class Password
|
||||||
|
{
|
||||||
|
|
||||||
public static function _crypt($password) {
|
public static function _crypt($password)
|
||||||
return crypt($password);
|
{
|
||||||
|
return sha1($password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function _verify($user_input, $hashed_password){
|
public static function _verify($user_input, $hashed_password)
|
||||||
if (crypt($user_input, $hashed_password) == $hashed_password) {
|
{
|
||||||
|
if (sha1($user_input) == $hashed_password) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public static function _uverify($user_input, $hashed_password){
|
public static function _uverify($user_input, $hashed_password)
|
||||||
|
{
|
||||||
if ($user_input == $hashed_password) {
|
if ($user_input == $hashed_password) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
public static function _gen(){
|
public static function _gen()
|
||||||
|
{
|
||||||
$pass = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@#!123456789', 8)), 0, 8);
|
$pass = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@#!123456789', 8)), 0, 8);
|
||||||
return $pass;
|
return $pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
|
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
|
||||||
|
|
||||||
@ -205,7 +206,7 @@ switch ($action) {
|
|||||||
$company = _post('company');
|
$company = _post('company');
|
||||||
$theme = _post('theme');
|
$theme = _post('theme');
|
||||||
$address = _post('address');
|
$address = _post('address');
|
||||||
if($company == '' OR $theme == '' OR $address == ''){
|
if ($company == '' or $theme == '' or $address == '') {
|
||||||
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
|
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
|
||||||
} else {
|
} else {
|
||||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyName')->find_one();
|
$d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyName')->find_one();
|
||||||
@ -240,7 +241,7 @@ switch ($action) {
|
|||||||
$tzone = _post('tzone');
|
$tzone = _post('tzone');
|
||||||
$date_format = _post('date_format');
|
$date_format = _post('date_format');
|
||||||
$lan = _post('lan');
|
$lan = _post('lan');
|
||||||
if($tzone == '' OR $date_format == '' OR $lan == ''){
|
if ($tzone == '' or $date_format == '' or $lan == '') {
|
||||||
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
|
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
|
||||||
} else {
|
} else {
|
||||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'timezone')->find_one();
|
$d = ORM::for_table('tbl_appconfig')->where('setting', 'timezone')->find_one();
|
||||||
@ -280,7 +281,7 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'change-password':
|
case 'change-password':
|
||||||
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
|
if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
|
||||||
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
|
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,8 +390,7 @@ switch ($action) {
|
|||||||
|
|
||||||
$res_tables->free();
|
$res_tables->free();
|
||||||
|
|
||||||
foreach($aTables as $table)
|
foreach ($aTables as $table) {
|
||||||
{
|
|
||||||
print("-- --------------------------------------------------------\n");
|
print("-- --------------------------------------------------------\n");
|
||||||
print("-- Structure for '" . $table . "'\n");
|
print("-- Structure for '" . $table . "'\n");
|
||||||
print("--\n\n");
|
print("--\n\n");
|
||||||
@ -428,7 +428,6 @@ switch ($action) {
|
|||||||
$res_select->free();
|
$res_select->free();
|
||||||
}
|
}
|
||||||
_log('[' . $admin['username'] . ']: ' . $_L['Download_Database_Backup'], 'Admin', $admin['id']);
|
_log('[' . $admin['username'] . ']: ' . $_L['Download_Database_Backup'], 'Admin', $admin['id']);
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
print($e->getMessage());
|
print($e->getMessage());
|
||||||
}
|
}
|
||||||
@ -452,7 +451,7 @@ switch ($action) {
|
|||||||
$folder = _post('folder');
|
$folder = _post('folder');
|
||||||
$translator = _post('translator');
|
$translator = _post('translator');
|
||||||
|
|
||||||
if ($name == '' OR $folder == ''){
|
if ($name == '' or $folder == '') {
|
||||||
$msg .= $_L['All_field_is_required'] . '<br>';
|
$msg .= $_L['All_field_is_required'] . '<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user