add passw3ord
This commit is contained in:
@@ -131,5 +131,12 @@ abstract class BaseController extends Controller
|
|||||||
return json_decode($result, true);
|
return json_decode($result, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function randomPassword( $length = 8 )
|
||||||
|
{
|
||||||
|
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
|
||||||
|
$length = rand(10, 16);
|
||||||
|
$password = substr( str_shuffle(sha1(rand() . time()) . $chars ), 0, $length );
|
||||||
|
return $password;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Controllers;
|
|||||||
class Employers extends BaseController
|
class Employers extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public function verifyEmployer()
|
public function verifyEmployer()
|
||||||
{
|
{
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
@@ -17,9 +18,17 @@ class Employers extends BaseController
|
|||||||
$query = $this->db->query($findEmp);
|
$query = $this->db->query($findEmp);
|
||||||
$row = $query->getResult('array');
|
$row = $query->getResult('array');
|
||||||
$employer_uid = $row[0]['employer_uid'];
|
$employer_uid = $row[0]['employer_uid'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($row[0]['uid']!='' ){
|
if ($row[0]['uid']!='' ){
|
||||||
log_message('error', "Call API---=>");
|
log_message('error', "Call API---=>");
|
||||||
$checkData = $this->APIcall("POST", "http://10.10.10.48:6332/api/verify/employer", json_encode($row[0]));
|
$api_data = $row[0];
|
||||||
|
$api_data["signatory_password"] = $this->randomPassword(); // "1000011";
|
||||||
|
$api_data["signatory_email"] = "ameye+signatory@chiefsoft.com";
|
||||||
|
$api_data["signatory_name"] = "Signatory UBA";
|
||||||
|
|
||||||
|
$checkData = $this->APIcall("POST", "http://10.10.10.48:6332/api/verify/employer", json_encode($api_data));
|
||||||
}else{
|
}else{
|
||||||
log_message('error', "Not found API---=>");
|
log_message('error', "Not found API---=>");
|
||||||
}
|
}
|
||||||
@@ -45,10 +54,9 @@ class Employers extends BaseController
|
|||||||
'message' => 'Verification text sent to employer',
|
'message' => 'Verification text sent to employer',
|
||||||
'call_return' => '100',
|
'call_return' => '100',
|
||||||
'verification_id' => $addedData["uid"],
|
'verification_id' => $addedData["uid"],
|
||||||
'status' => $checkData["res"]["status"],
|
|
||||||
'verify_data' => $checkData["res"]["data"]
|
'verify_data' => $checkData["res"]["data"]
|
||||||
];
|
];
|
||||||
|
// 'status' => $checkData["res"]["status"],
|
||||||
return $this->respond($response, 200);
|
return $this->respond($response, 200);
|
||||||
} else {
|
} else {
|
||||||
$response = [
|
$response = [
|
||||||
|
|||||||
Reference in New Issue
Block a user