本文整理汇总了PHP中SoapClient::getUserByEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapClient::getUserByEmail方法的具体用法?PHP SoapClient::getUserByEmail怎么用?PHP SoapClient::getUserByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapClient
的用法示例。
在下文中一共展示了SoapClient::getUserByEmail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Authenticate the user
*
* @return Response
*/
public function store()
{
try {
$userAgent = array("platform" => Useragent::platform(), "browser" => Useragent::browser(), "version" => Useragent::version(), "mobile" => Useragent::mobile(), "robot" => Useragent::robot(), "agent" => Useragent::agent_string(), "accept_lang" => Useragent::accept_lang(), "accept_charset" => Useragent::accept_charset(), "ip_address" => $_SERVER['REMOTE_ADDR']);
if (Input::get('password')) {
$authService = new SoapClient(Config::get('wsdl.auth'));
$token = $authService->authenticateEmail(array("email" => Input::get('email'), "password" => Input::get('password'), "userAgent" => print_r($userAgent, true)));
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('user_agent', "PHP-SOAP/" . PHP_VERSION . "\r\n" . "AuthToken: " . $token->AuthToken);
Session::put('user.token', $token);
try {
$userService = new SoapClient(Config::get('wsdl.user'));
$result = $userService->getUserByEmail(array("email" => Input::get('email')));
$user = $result->user;
if ($user->businessAccount == true) {
if (isset($user->addresses) && is_object($user->addresses)) {
$user->addresses = array($user->addresses);
}
}
Session::put('user.data', $user);
return array('success' => 'true');
} catch (InnerException $ex) {
throw new Exception($ex->faultstring);
}
}
} catch (Exception $ex) {
return array('error' => $ex->getMessage());
}
}
示例2: registerUser
/**
* Invokes the user registration on WS.
*
* @return response
* @throws Exception in case of WS error
*/
public function registerUser()
{
try {
$userService = new SoapClient(Config::get('wsdl.user'));
$user = new UserModel(Input::all());
$array = array("user" => $user, "password" => Input::get('password'), "invitationCode" => Input::get('code'));
if (Input::get('ref')) {
$array['referrerId'] = Input::get('ref');
}
$result = $userService->registerUser($array);
$authService = new SoapClient(Config::get('wsdl.auth'));
$token = $authService->authenticateEmail(array("email" => Input::get('email'), "password" => Input::get('password'), "userAgent" => NULL));
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('user_agent', "PHP-SOAP/" . PHP_VERSION . "\r\n" . "AuthToken: " . $token->AuthToken);
Session::put('user.token', $token);
try {
$userService = new SoapClient(Config::get('wsdl.user'));
$result = $userService->getUserByEmail(array("email" => Input::get('email')));
$user = $result->user;
/* if ($user -> businessAccount == true) {
if (isset($user -> addresses) && is_object($user -> addresses)) {
$user -> addresses = array($user -> addresses);
}
} */
Session::put('user.data', $user);
return array('success' => true);
} catch (InnerException $ex) {
//throw new Exception($ex -> faultstring);
return array('success' => false, 'faultstring' => $ex->faultstring);
}
} catch (Exception $ex) {
return array('success' => false, 'faultstring' => $ex->faultstring);
}
}
示例3: updateProfile
/**
* Update profile
*
* @return Response
*/
public function updateProfile()
{
$session = Session::get('user');
$userService = new SoapClient(Config::get('wsdl.user'), array());
$geoService = new SoapClient(Config::get('wsdl.utility'), array());
$currentUser = $userService->getUserByEmail(array('email' => $session['data']->email))->user;
$currentUser->businessName = Input::get('businessName');
$currentUser->about = Input::get('about');
$currentUser->address = $geoService->getAddressByZipcode(array("zipcode" => Input::get('zipCode')))->address;
$currentUser->website = Input::get('website');
$currentUser->contactName = Input::get('contactName');
$currentUser->contactNumber = Input::get('contactNumber');
$currentUser->email = Input::get('email');
try {
$userService->updateUser(array('user' => $currentUser));
} catch (Exception $ex) {
}
}
示例4: updateProfile
/**
* Update profile
*
* @return Response
*/
public function updateProfile()
{
$session = Session::get('user');
$userService = new SoapClient(Config::get('wsdl.user'), array());
$geoService = new SoapClient(Config::get('wsdl.utility'), array());
$currentUser = $userService->getUserByEmail(array('email' => $session['data']->email))->user;
if (!$currentUser->address) {
$address = new Address();
} else {
$address = new Address($currentUser->address);
}
$currentUser->firstName = Input::get('first_name');
$currentUser->lastName = Input::get('last_name');
$currentUser->about = Input::get('about');
if (Input::get('zipCode')) {
$address = $geoService->getAddressByZipcode(array("zipcode" => Input::get('zipCode')));
$currentUser->address = $address->address;
} else {
if (Input::get('zipCode') == "") {
$currentUser->address = new Address();
}
}
try {
$userService->updateUser(array('user' => $currentUser));
} catch (Exception $ex) {
}
}
示例5: destroy
/**
* Delete store
*
* @return Response
*/
public function destroy($id)
{
$session = Session::get('user');
$userService = new SoapClient(Config::get('wsdl.user'), array());
$currentUser = $userService->getUserByEmail(array('email' => $session['data']->email))->user;
if (is_object($currentUser->addresses)) {
$currentUser->addresses = array($currentUser->addresses);
}
$addresses = $currentUser->addresses;
foreach ($addresses as $k => $val) {
if ($val->id == $id) {
$val->deleted = true;
$addresses[$k] = $val;
}
}
$currentUser->addresses = $addresses;
try {
$userService->updateUser(array('user' => $currentUser));
} catch (Exception $ex) {
}
}
示例6: index
/**
* Ad listing.
*
* @return Response
*/
public function index()
{
try {
$session = Session::get('user');
$userService = new SoapClient(Config::get('wsdl.user'), array());
$currentUser = $userService->getUserByEmail(array('email' => $session['data']->email))->user;
$filter = new Filter();
$filter->includeOwned = 1;
$filter->includeCannotRequest = 1;
$filter->includeInactive = 0;
$filter->includePickUp = null;
$filter->includeShipping = null;
$type = Input::get('order');
$adtype = Input::get('types');
$filter->searchString = Input::get('keywords');
if (Input::get('category')) {
$category = array(Input::get('category'));
} else {
$category = null;
}
if ($delivery = Input::get('delivery')) {
if ($delivery == "pickup") {
$filter->includePickUp = 1;
$filter->includeShipping = null;
} else {
if ($delivery == "shipping") {
$filter->includePickUp = null;
$filter->includeShipping = 1;
}
}
}
$filter->categories = $category;
if (!$type) {
$type = AdController::TYPE_NEWEST;
}
if ($type == AdController::TYPE_NEWEST) {
$filter->orderAsc = false;
$filter->orderClosest = false;
$filter->filterType = Filter::FILTER_TYPE_ACTIVE;
} else {
if ($type == AdController::TYPE_OLDEST) {
$filter->orderAsc = true;
$filter->orderClosest = false;
$filter->filterType = Filter::FILTER_TYPE_ACTIVE;
} else {
if ($type == AdController::TYPE_CLOSEST) {
$filter->orderAsc = true;
$filter->orderClosest = true;
$filter->filterType = Filter::FILTER_TYPE_ACTIVE;
$filter->latitude = $currentUser != null && $currentUser->address != null && isset($currentUser->address->latitude) ? $currentUser->address->latitude : null;
$filter->longitude = $currentUser != null && $currentUser->address != null && isset($currentUser->address->longitude) ? $currentUser->address->longitude : null;
} else {
if ($type == AdController::TYPE_GIFTED) {
$filter->orderAsc = false;
$filter->orderClosest = false;
$filter->filterType = Filter::FILTER_TYPE_GIFTED;
}
}
}
}
if ($adtype) {
$filter->types = $adtype;
}
$adService = new SoapClient(Config::get('wsdl.ad'), array());
$result = $adService->getAdsExDetail(array("lastIndex" => -1, "numberAds" => 15, "filter" => $filter, "includeImages" => true, "includeCreator" => true, "includeCommentsNumber" => 2, "includeCreatorStatistics" => true));
$creators = array();
if (isset($result->ad->type)) {
$ads = $result;
} elseif (isset($result->ad)) {
$ads = $result->ad;
} else {
$ads = array();
}
$results = array();
foreach ($ads as $k => $ad) {
$ad = new Ad($ad);
$creators[$ad->creator->id] = $ad->creator;
if (isset($currentUser->address) && isset($currentUser->address->latitude) && isset($currentUser->address->longitude) && isset($ad->address) && isset($ad->address->latitude) && isset($ad->address->longitude)) {
$ad->distance = $this->distance_haversine($currentUser->address->latitude, $currentUser->address->longitude, $ad->address->latitude, $ad->address->longitude);
}
if (isset($ad->requests)) {
if (is_array($ad->requests->item)) {
foreach ($ad->requests->item as $k => $v) {
$v = new Requested($v);
if ($v->user->id == $user_id) {
$ad->request = $v;
}
}
} else {
$v = new Requested($ad->requests->item);
if ($v->user->id == $user_id) {
$ad->request = $v;
}
}
}
//.........这里部分代码省略.........