mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-26 13:10:55 -08:00
revert from develop
This commit is contained in:
parent
e09516d69b
commit
41e89123e1
8
app/Console/Commands/LdapSync.php
Executable file → Normal file
8
app/Console/Commands/LdapSync.php
Executable file → Normal file
|
@ -49,7 +49,7 @@ class LdapSync extends Command
|
|||
$ldap_result_last_name = Setting::getSettings()->ldap_lname_field;
|
||||
$ldap_result_first_name = Setting::getSettings()->ldap_fname_field;
|
||||
|
||||
$ldap_result_active_flag = Setting::getSettings()->ldap_active_flag;
|
||||
$ldap_result_active_flag = Setting::getSettings()->ldap_active_flag_field;
|
||||
$ldap_result_emp_num = Setting::getSettings()->ldap_emp_num;
|
||||
$ldap_result_email = Setting::getSettings()->ldap_email;
|
||||
$ldap_result_phone = Setting::getSettings()->ldap_phone_field;
|
||||
|
@ -253,8 +253,8 @@ class LdapSync extends Command
|
|||
|
||||
if ($item['ldap_location_override'] == true) {
|
||||
$user->location_id = $item['location_id'];
|
||||
} elseif ((isset($location))) {
|
||||
if ((array_key_exists('id', $location))) {
|
||||
} elseif ((isset($location)) && (! empty($location))) {
|
||||
if ((is_array($location)) && (array_key_exists('id', $location))) {
|
||||
$user->location_id = $location['id'];
|
||||
} elseif (is_object($location)) {
|
||||
$user->location_id = $location->id;
|
||||
|
@ -276,7 +276,7 @@ class LdapSync extends Command
|
|||
$item['status'] = 'error';
|
||||
}
|
||||
|
||||
$summary[] = $item;
|
||||
array_push($summary, $item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class Helper
|
|||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.3]
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public static function defaultChartColors($index = 0)
|
||||
{
|
||||
|
@ -333,6 +333,8 @@ class Helper
|
|||
'#92896B',
|
||||
];
|
||||
|
||||
|
||||
|
||||
return $colors[$index];
|
||||
}
|
||||
|
||||
|
@ -414,7 +416,8 @@ class Helper
|
|||
*
|
||||
*/
|
||||
$LocaleInfo = localeconv();
|
||||
$floatString = str_replace(array(',', $LocaleInfo['decimal_point']), array('', '.'), $floatString);
|
||||
$floatString = str_replace(',', '', $floatString);
|
||||
$floatString = str_replace($LocaleInfo['decimal_point'], '.', $floatString);
|
||||
// Strip Currency symbol
|
||||
// If no currency symbol is set, default to $ because Murica
|
||||
$currencySymbol = $LocaleInfo['currency_symbol'];
|
||||
|
@ -424,7 +427,7 @@ class Helper
|
|||
|
||||
$floatString = str_replace($currencySymbol, '', $floatString);
|
||||
|
||||
return (float)$floatString;
|
||||
return floatval($floatString);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -432,7 +435,7 @@ class Helper
|
|||
*
|
||||
* @author [B. Wetherington] [<bwetherington@grokability.com>]
|
||||
* @since [v5.2]
|
||||
* @return float
|
||||
* @return Float
|
||||
*/
|
||||
public static function ParseCurrency($currencyString) {
|
||||
$without_currency = str_replace(Setting::getSettings()->default_currency, '', $currencyString); //generally shouldn't come up, since we don't do this in fields, but just in case it does...
|
||||
|
@ -592,11 +595,10 @@ class Helper
|
|||
|
||||
/**
|
||||
* Generates a random string
|
||||
* This function does not generate cryptographically secure values, and should not be used for cryptographic purposes
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.0]
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public static function generateRandomString($length = 10)
|
||||
{
|
||||
|
@ -604,7 +606,7 @@ class Helper
|
|||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[random_int(0, $charactersLength - 1)];
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
|
||||
return $randomString;
|
||||
|
@ -780,15 +782,17 @@ class Helper
|
|||
/**
|
||||
* Check to see if the given key exists in the array, and trim excess white space before returning it
|
||||
*
|
||||
* @author Daniel Melzter
|
||||
* @since 3.0
|
||||
* @param $array array
|
||||
* @param $key string
|
||||
* @param $default string
|
||||
* @return string
|
||||
*@author Daniel Melzter
|
||||
* @since 3.0
|
||||
*/
|
||||
public static function array_smart_fetch(array $array, string $key, string $default = '')
|
||||
public static function array_smart_fetch(array $array, $key, $default = '')
|
||||
{
|
||||
array_change_key_case($array, CASE_LOWER);
|
||||
|
||||
return array_key_exists(strtolower($key), array_change_key_case($array)) ? e(trim($array[$key])) : $default;
|
||||
}
|
||||
|
||||
|
@ -969,6 +973,7 @@ class Helper
|
|||
case 'gif':
|
||||
case 'png':
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue