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