expnaded sample env

This commit is contained in:
2023-02-25 18:34:20 -05:00
parent b5736e8121
commit b6abcb1586
12 changed files with 536 additions and 47 deletions
+39 -5
View File
@@ -40,6 +40,8 @@ class Myfitauth extends BaseController
'account' => ['POST'],
'login' => ['POST'],
'resetpass' => ['POST'],
'signup-code' => ['POST'],
'resetpass-code' => ['POST']
];
$res1 = [];
@@ -59,19 +61,51 @@ class Myfitauth extends BaseController
$res1 = $userAccess->startLogin($raw_array);
break;
case 'account':
$res1 = $this->dummyData($raw_array);
$userSignUp = new \App\Models\userSignUp();
//$this->push();
$res1 = $userSignUp->startSignUp($raw_array);
break;
case 'resetpass':
$res1 = [
'email' => $raw_array['email'],
'status' => 1,
];
$passReset = new \App\Models\usersResetPass();
$res1 = $passReset->startPassReset($raw_array);
break;
case 'signup-code':
$userSignUp = new \App\Models\userSignUp();
$res1 = $userSignUp->tempCodes();
break;
case 'resetpass-code':
$passReset = new \App\Models\usersResetPass();
$res1 = $passReset->tempCodes();
break;
}
return $this->response->setJson($res1);
}
public function push()
{
$to = 'ameye@chiefsoft.com';//Type here the mail address where you want to send
$subject = 'myFit Signup';//Write here Subject of Email
$message='Conngrats ! You did it.';//Write the message you want to send
$email = \Config\Services::email();
$email->setTo($to);
$email->setFrom('works@chiefsoft.com', 'Just testing the emsil function');//set From
$email->setSubject($subject);
$email->setMessage($message);
if($email->send())
{
//echo 'Email has been Sent.';
log_message('critical', "Email has been Sent" );
}
else{
// echo 'Something went wrong !';
log_message('critical', "Something went wrong" );
}
}
//this is dummy function to establish the endpoints before real implementations
private function dummyData($raw_array)
{
+5
View File
@@ -60,6 +60,7 @@ class Myfituser extends BaseController
'trackcategory' => ['GET'],
'resetpass' => ['POST'],
'tracking' => ['POST'],
'trackinghx' => ['GET']
];
$res1 = [];
@@ -138,6 +139,10 @@ class Myfituser extends BaseController
$myfitTracking = new \App\Models\myfitTracking();
$res1 = $myfitTracking->trackEngine($raw_array);
break;
case 'trackinghx':
$myfitTracking = new \App\Models\myfitTracking();
$res1 = $myfitTracking->readTracking($raw_array);
break;
}
return $this->response->setJson($res1);