mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-13 03:18:04 -04:00
Remove grunt045 from zipped opensourcepos file. Also fix the call to array_walker since the parameters (even if not used) are validated in PHP 8.
This commit is contained in:
@@ -7,7 +7,7 @@ module.exports = function(grunt) {
|
||||
'vendor/**',
|
||||
'app/**',
|
||||
'!/tests',
|
||||
'!/grunt045',
|
||||
'!grunt045**',
|
||||
'!/public/images/menubar/png/',
|
||||
'!/public/dist/bootswatch/',
|
||||
'/public/dist/bootswatch/*/*.css',
|
||||
|
||||
@@ -283,8 +283,25 @@ class Config extends Secure_Controller
|
||||
{
|
||||
$encrypter = Services::encrypter();
|
||||
|
||||
$data['mailchimp']['api_key'] = $encrypter->decrypt($this->config['mailchimp_api_key'] ?? '');
|
||||
$data['mailchimp']['list_id'] = $encrypter->decrypt($this->config['mailchimp_list_id'] ?? '');
|
||||
$mailchimp_api_key = $this->config['mailchimp_api_key'];
|
||||
if(!empty($mailchimp_api_key))
|
||||
{
|
||||
$data['mailchimp']['api_key'] = $encrypter->decrypt($mailchimp_api_key);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['mailchimp']['api_key'] = '';
|
||||
}
|
||||
|
||||
$mailchimp_list_id = $this->config['mailchimp_list_id'];
|
||||
if(!empty($mailchimp_list_id))
|
||||
{
|
||||
$data['mailchimp']['list_id'] = $encrypter->decrypt($mailchimp_list_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['mailchimp']['list_id'] = '';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,7 +42,16 @@ class Customers extends Persons
|
||||
|
||||
$encrypter = Services::encrypter();
|
||||
|
||||
$this->_list_id = $encrypter->decrypt($this->config['mailchimp_list_id']);
|
||||
$mailchimp_list_id = $this->config['mailchimp_list_id'];
|
||||
|
||||
if(!empty($mailchimp_list_id))
|
||||
{
|
||||
$this->_list_id = $encrypter->decrypt($this->config['mailchimp_list_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_list_id = "";
|
||||
}
|
||||
}
|
||||
|
||||
public function getIndex(): void
|
||||
|
||||
@@ -15,9 +15,10 @@ class Home extends Secure_Controller
|
||||
echo view('home/home');
|
||||
}
|
||||
|
||||
public function getLogout(): void
|
||||
public function getLogout(): \CodeIgniter\HTTP\RedirectResponse
|
||||
{
|
||||
$this->employee->logout();
|
||||
return redirect()->to('login');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -593,14 +593,14 @@ function valid_decimal(string $decimal): bool //TODO: need a better name for $de
|
||||
|
||||
function encode_array(array $data): array
|
||||
{
|
||||
array_walk($data, function(&$value, &$key) { $value = rawurlencode($value);});
|
||||
array_walk($data, function(&$value, $key) { $value = rawurlencode($value);});
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function decode_array(array $data): array
|
||||
{
|
||||
array_walk($data, function(&$value, &$key) { $value = rawurldecode($value);});
|
||||
array_walk($data, function(&$value, $key) { $value = rawurldecode($value);});
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,14 @@ class Email_lib
|
||||
{
|
||||
$this->email = new Email();
|
||||
$this->config = config('OSPOS')->settings;
|
||||
|
||||
$encrypter = Services::encrypter();
|
||||
|
||||
$smtp_pass = $this->config['smtp_pass'];
|
||||
if(!empty($smtp_pass))
|
||||
{
|
||||
$smtp_pass = $encrypter->decrypt($smtp_pass);
|
||||
}
|
||||
|
||||
$email_config = [
|
||||
'mailtype' => 'html',
|
||||
@@ -36,7 +42,7 @@ class Email_lib
|
||||
'mailpath' => $this->config['mailpath'],
|
||||
'smtp_host' => $this->config['smtp_host'],
|
||||
'smtp_user' => $this->config['smtp_user'],
|
||||
'smtp_pass' => $encrypter->decrypt($this->config['smtp_pass']),
|
||||
'smtp_pass' => $smtp_pass,
|
||||
'smtp_port' => $this->config['smtp_port'],
|
||||
'smtp_timeout' => $this->config['smtp_timeout'],
|
||||
'smtp_crypto' => $this->config['smtp_crypto']
|
||||
|
||||
@@ -41,9 +41,14 @@ class MailchimpConnector
|
||||
|
||||
$encrypter = Services::encrypter();
|
||||
|
||||
$this->_api_key = empty($api_key)
|
||||
? $encrypter->decrypt($config['mailchimp_api_key']) //TODO: Hungarian notation
|
||||
: $api_key; //TODO: Hungarian notation
|
||||
$mailchimp_api_key = $config['mailchimp_api_key'];
|
||||
|
||||
if(!empty($mailchimp_api_key))
|
||||
{
|
||||
$this->_api_key = empty($api_key)
|
||||
? $encrypter->decrypt($mailchimp_api_key) //TODO: Hungarian notation
|
||||
: $api_key; //TODO: Hungarian notation
|
||||
}
|
||||
|
||||
if(!empty($this->_api_key)) //TODO: Hungarian notation
|
||||
{
|
||||
|
||||
@@ -26,10 +26,16 @@ class Sms_lib
|
||||
public function sendSMS(int $phone, string $message): bool
|
||||
{
|
||||
$config = config('OSPOS')->settings;
|
||||
|
||||
$encrypter = Services::encrypter();
|
||||
|
||||
$password = $config['msg_pwd'];
|
||||
if(!empty($password))
|
||||
{
|
||||
$password = $encrypter->decrypt($password);
|
||||
}
|
||||
|
||||
$username = $config['msg_uid'];
|
||||
$password = $encrypter->decrypt($config['msg_pwd']);
|
||||
$originator = $config['msg_src'];
|
||||
|
||||
$response = FALSE;
|
||||
|
||||
@@ -408,11 +408,9 @@ class Employee extends Person
|
||||
/**
|
||||
* Logs out a user by destroying all session data and redirect to log in
|
||||
*/
|
||||
public function logout(): RedirectResponse
|
||||
public function logout()
|
||||
{
|
||||
session()->destroy();
|
||||
|
||||
return redirect()->to('login');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user