Create account controller

This commit is contained in:
CHIEFSOFT\ameye
2024-07-07 14:03:25 -04:00
parent e1bc281ab6
commit 09c14cf2ca
2 changed files with 34 additions and 1 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ $routes->post('/en/wrench/api/v1/helpdata', 'WrenchFaq::helpgate');
$routes->post('/en/wrench/api/v1/apigate', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/generics', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/createuser', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/createuser', 'WrenchAccount::CreateNewAccount'); // 'WrenchApi::apigate'
$routes->post('/en/wrench/api/v1/verifysignuplink', 'WrenchApi::apigate');
$routes->post('/en/wrench/api/v1/completesignuplink', 'WrenchApi::apigate');
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Controllers;
class WrenchAccount extends BaseController
{
public function CreateNewAccount(){
$out=[];
$raw_json = file_get_contents('php://input');
$raw_array = json_decode($raw_json, true);
$in = $raw_array;
$in["action"] = WRENCHBOARD_ACCOUNT_PENDING;
$in["street1"] = $in["streetaddress"];
$in["zipcode"] = $in["zip"];
if (!isset($in["country"]) || $in["country"]==""){
$in["country"] = "US";
}
$in["loc"] = $_SERVER["REMOTE_ADDR"];
$in["mobile"] = "MOBILE";
// $wrenchboard = new \App\Models\BackendModel();
$ret = $this->wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret;
return $this->summaryReturnData($in,$out); //json_encode( $final_out );
}
}