当前位置: 首页>>代码示例>>PHP>>正文


PHP is_email_address函数代码示例

本文整理汇总了PHP中is_email_address函数的典型用法代码示例。如果您正苦于以下问题:PHP is_email_address函数的具体用法?PHP is_email_address怎么用?PHP is_email_address使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_email_address函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Subscribe

		public function Subscribe()
		{
			if(!isset($_POST['check'])) {
				$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
				$GLOBALS['Class'] = "ErrorMessage";
				$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSpammerVerification');
			}
			else if(isset($_POST['nl_first_name']) && isset($_POST['nl_email'])) {

				$first_name = $_POST['nl_first_name'];
				$email = $_POST['nl_email'];

				if (!is_email_address($email)) {
					$GLOBALS['SubscriptionHeading'] = GetLang('NewsletterSubscription');
					$GLOBALS['Class'] = "ErrorMessage";
					$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterEnterValidEmail');
				} else {
					$subscription = new Interspire_EmailIntegration_Subscription_Newsletter($email, $first_name);
					$results = $subscription->routeSubscription();

					$success = false;
					$existed = false;

					foreach ($results as /** @var Interspire_EmailIntegration_SubscriberActionResult */$result) {
						// message sent to visitor is 'ok' if even one subscription worked; other failures will be logged internally & emailed to store owner
						// this is a little counter-intuitive when multiple modules are enabled but it's the best compromise I think short of sending info about every module back to the visitor, who shouldn't be concered with such detail
						if ($result->pending) {
							$success = true;
						} else {
							if ($result->success) {
								$success = true;
							}
							if ($result->existed) {
								$existed = true;
							}
						}
					}

					if ($success) {
						if ($existed) {
							// most APIs will simply update existing details, rather than error - but this mimmicks the existing behaviour of ISC if the API can let us know the subscriber existed
							$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
							$GLOBALS['Class'] = "ErrorMessage";
							$GLOBALS['SubscriptionMessage'] = sprintf(GetLang('NewsletterAlreadySubscribed'), $email); // legacy sprintf
						} else {
							$GLOBALS['SubscriptionHeading'] = GetLang('NewsletterThanksForSubscribing');
							$GLOBALS['Class'] = "";
							$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSubscribedSuccessfully') . sprintf(" <a href='%s'>%s.</a>", $GLOBALS['ShopPath'], GetLang('Continue'));
						}
					} else {
						$GLOBALS['SubscriptionHeading'] = GetLang('Oops');
						$GLOBALS['Class'] = "ErrorMessage";
						$GLOBALS['SubscriptionMessage'] = GetLang('NewsletterSubscribeError');
					}
				}
			}
			$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(sprintf("%s - %s", GetConfig('StoreName'), GetLang('NewsletterSubscription')));
			$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("newsletter_subscribe");
			$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:60,代码来源:class.subscribe.php

示例2: AddSubscriberToNewsletter

 /**
  *	Add a subscriber to the mailing list for the newsletter. Returns an array contaning
  *	status (success/fail) and an optional return message
  */
 public function AddSubscriberToNewsletter($FirstName, $Email)
 {
     // Is this email address valid?
     if (!is_email_address($Email)) {
         $result = array("status" => "fail", "message" => sprintf(GetLang('NewsletterInvalidEmail'), isc_html_escape($Email)));
         // Is this person already in the subscribers table?
     } else {
         if ($this->SubscriberExists(GetConfig('MailNewsletterList'), $Email)) {
             $result = array("status" => "fail", "message" => sprintf(GetLang('NewsletterAlreadySubscribed'), isc_html_escape($Email)));
             // Add the subscriber
         } else {
             $add_xml = "<xmlrequest>\n\t\t\t\t\t\t\t<username>" . GetConfig('MailUsername') . "</username>\n\t\t\t\t\t\t\t<usertoken>" . GetConfig('MailXMLToken') . "</usertoken>\n\t\t\t\t\t\t\t<requesttype>subscribers</requesttype>\n\t\t\t\t\t\t\t<requestmethod>AddSubscriberToList</requestmethod>\n\t\t\t\t\t\t\t<details>\n\t\t\t\t\t\t\t\t<emailaddress>" . $Email . "</emailaddress>\n\t\t\t\t\t\t\t\t<mailinglist>" . GetConfig('MailNewsletterList') . "</mailinglist>\n\t\t\t\t\t\t\t\t<confirmed>yes</confirmed>";
             // Do we need to add the first name custom field?
             if (GetConfig('MailNewsletterCustomField') > 0) {
                 $add_xml .= "<customfields>\n\t\t\t\t\t\t\t\t\t<fieldid>" . GetConfig('MailNewsletterCustomField') . "</fieldid>\n\t\t\t\t\t\t\t\t\t<value>" . $FirstName . "</value>\n\t\t\t\t\t\t\t\t</customfields>";
             }
             $add_xml .= "\n\t\t\t\t\t\t\t</details>\n\t\t\t\t\t\t</xmlrequest>";
             $add_xml = urlencode($add_xml);
             $result = PostToRemoteFileAndGetResponse(GetConfig('MailXMLPath'), "xml=" . $add_xml);
             $xml = @simplexml_load_string($result);
             $response = '';
             if ($xml && isset($xml->status)) {
                 $response = $xml->status;
             }
             if ($response == "SUCCESS") {
                 $result = array("status" => "success", "message" => GetLang('NewsletterSubscribedSuccessfully'));
             } else {
                 $result = array("status" => "fail", "message" => sprintf(GetLang('NewsletterSubscribeErrorIEM'), $xml->errormessage));
             }
         }
     }
     return $result;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:37,代码来源:class.sendstudio.php

示例3: au_landing_user_login

function au_landing_user_login($event, $type, $object)
{
    if (elgg_instanceof($object, 'user')) {
        if (!is_email_address($object->email)) {
            system_message(elgg_echo('au_landing:invalidemail'));
        }
    }
}
开发者ID:AU-Landing-Project,项目名称:au_landing,代码行数:8,代码来源:events.php

示例4: put

 /**
  * {@inheritdoc}
  */
 public function put(ParameterBag $params)
 {
     $owner = get_entity($params->guid);
     if (!$owner->canEdit()) {
         throw new GraphException("You are not allowed to modify this user's profile", HttpResponse::HTTP_FORBIDDEN);
     }
     $profile_fields = (array) elgg_get_config('profile_fields');
     $access_id = $params->access_id !== null ? $params->access_id : get_default_access($owner);
     $input = array();
     foreach ($profile_fields as $field => $valuetype) {
         // Making sure the consumer has sent these fields with the request
         if (isset($params->{$field}) && $this->request->get($field) !== null) {
             $value = $params->{$field};
             $value = _elgg_html_decode($value);
             if (!is_array($value) && $valuetype != 'longtext' && elgg_strlen($value) > 250) {
                 throw new GraphException(elgg_echo('profile:field_too_long', array(elgg_echo("profile:{$field}")), HttpResponse::HTTP_BAD_REQUEST));
             }
             if ($value && $valuetype == 'url' && !preg_match('~^https?\\://~i', $value)) {
                 $value = "http://{$value}";
             }
             if ($valuetype == 'tags') {
                 $value = string_to_tag_array($value);
             }
             if ($valuetype == 'email' && !empty($value) && !is_email_address($value)) {
                 throw new GraphException(elgg_echo('profile:invalid_email', array(elgg_echo("profile:{$field}"))), HttpResponse::HTTP_BAD_REQUEST);
             }
             $input[$field] = $value;
         }
     }
     // go through custom fields
     if (sizeof($input) > 0) {
         foreach ($input as $shortname => $value) {
             $options = array('guid' => $owner->guid, 'metadata_name' => $shortname, 'limit' => false);
             elgg_delete_metadata($options);
             if (!is_null($value) && $value !== '') {
                 // only create metadata for non empty values (0 is allowed) to prevent metadata records
                 // with empty string values #4858
                 if (is_array($value)) {
                     $i = 0;
                     foreach ($value as $interval) {
                         $i++;
                         $multiple = $i > 1 ? TRUE : FALSE;
                         create_metadata($owner->guid, $shortname, $interval, 'text', $owner->guid, $access_id, $multiple);
                     }
                 } else {
                     create_metadata($owner->getGUID(), $shortname, $value, 'text', $owner->getGUID(), $access_id);
                 }
             }
         }
         $owner->save();
         // Notify of profile update
         elgg_trigger_event('profileupdate', $owner->type, $owner);
     }
     return $this->get($params);
 }
开发者ID:hypejunction,项目名称:hypegraph,代码行数:58,代码来源:UserProfile.php

示例5: __construct

 /**
  * Create or retrieve a Stripe customer account
  * @param mixed $user_attr	ElggUser or guid or email
  * @throws IOException
  */
 function __construct($user_attr = null)
 {
     if ($user_attr instanceof ElggUser) {
         $this->user = $user_attr;
     } else {
         if (is_email_address($user_attr)) {
             $users = get_user_by_email($user_attr);
             if (!$users) {
                 $customer_ref = elgg_get_plugin_setting($user_attr, 'stripe');
                 if ($customer_ref) {
                     $customer_ref = unserialize($customer_ref);
                 } else {
                     $customer_ref = array();
                 }
                 $customer_id = $customer_ref[0];
             } else {
                 $this->user = $users[0];
             }
             $email = $user_attr;
         } else {
             if (is_string($user_attr) && substr($user_attr, 0, 4) == 'cus_') {
                 $customer_id = $user_attr;
             } else {
                 if (is_numeric($user_attr)) {
                     $this->user = get_entity($user_attr);
                 }
             }
         }
     }
     if (!$this->user && $customer_id) {
         if ($user = stripe_get_user_from_customer_id($customer_id)) {
             $this->user = $user;
         }
     }
     if (!$this->user) {
         $this->user = new ElggUser();
         $this->user->email = $email;
         if ($customer_id) {
             $this->user->setPrivateSetting('stripe_customer_id', $customer_id);
         }
     }
     $this->account = $this->getCustomerAccount();
     if (!$this->account) {
         throw new IOException("Stripe customer account can not be retrieved or created");
     }
 }
开发者ID:Daltonmedia,项目名称:stripe,代码行数:51,代码来源:StripeCustomer.php

示例6: spam_login_filter_notify_admin

function spam_login_filter_notify_admin($blockedEmail, $blockedIp, $reason)
{
    if (elgg_get_plugin_setting('notify_by_mail', 'spam_login_filter') == "yes") {
        //Notify spam tentative to administrator
        $site = elgg_get_site_entity();
        if ($site && isset($site->email)) {
            $from = $site->email;
        } else {
            $from = 'noreply@' . get_site_domain($site->guid);
        }
        $message = sprintf(elgg_echo('spam_login_filter:notify_message'), $blockedEmail, $blockedIp, $reason);
        $to = elgg_get_plugin_setting('notify_mail_address', 'spam_login_filter');
        if (!is_email_address($to)) {
            return;
        }
        elgg_send_email($from, $to, elgg_echo('spam_login_filter:notify_subject'), $message);
    }
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:18,代码来源:start.php

示例7: ws_pack_auth_gettoken

/**
 * Allow login by username/email and password
 *
 * @param string $username username
 * @param string $password password
 *
 * @throws SecurityException
 *
 * @return void|string
 */
function ws_pack_auth_gettoken($username, $password)
{
    // check if username is an email address
    if (is_email_address($username)) {
        $users = get_user_by_email($username);
        // check if we have a unique user
        if (is_array($users) && count($users) == 1) {
            $username = $users[0]->username;
        }
    }
    // validate username and password
    if (true === elgg_authenticate($username, $password)) {
        $token = create_user_token($username);
        if ($token) {
            return $token;
        }
    }
    throw new SecurityException(elgg_echo("SecurityException:authenticationfailed"));
}
开发者ID:coldtrick,项目名称:ws_pack,代码行数:29,代码来源:auth.php

示例8: send_user_password_mail

/**
 * Send password for new user who is registered using facebook connect
 *
 * @param $email
 * @param $name
 * @param $username
 * @param $password
 */
function send_user_password_mail($email, $name, $username, $password)
{
    $site = elgg_get_site_entity();
    $email = trim($email);
    // send out other email addresses
    if (!is_email_address($email)) {
        return false;
    }
    $message = elgg_echo('facebook_connect:email:body', array($name, $site->name, $site->url, $username, $email, $password, $site->name, $site->url));
    $subject = elgg_echo('facebook_connect:email:subject', array($name));
    // create the from address
    $site = get_entity($site->guid);
    if ($site && isset($site->email)) {
        $from = $site->email;
    } else {
        $from = 'noreply@' . get_site_domain($site->guid);
    }
    elgg_send_email($from, $email, $subject, $message);
}
开发者ID:duanhv,项目名称:mdg-social,代码行数:27,代码来源:start.php

示例9: group_tools_invite_email

function group_tools_invite_email(ElggGroup $group, $email, $text = "", $resend = false)
{
    $result = false;
    if (!empty($group) && $group instanceof ElggGroup && !empty($email) && is_email_address($email) && ($loggedin_user = elgg_get_logged_in_user_entity())) {
        // get site secret
        $site_secret = get_site_secret();
        // generate invite code
        $invite_code = md5($site_secret . $email . $group->getGUID());
        if (!group_tools_check_group_email_invitation($invite_code, $group->getGUID()) || $resend) {
            // make site email
            $site = elgg_get_site_entity();
            if (!empty($site->email)) {
                if (!empty($site->name)) {
                    $site_from = $site->name . " <" . $site->email . ">";
                } else {
                    $site_from = $site->email;
                }
            } else {
                // no site email, so make one up
                if (!empty($site->name)) {
                    $site_from = $site->name . " <noreply@" . get_site_domain($site->getGUID()) . ">";
                } else {
                    $site_from = "noreply@" . get_site_domain($site->getGUID());
                }
            }
            if (!$resend) {
                // register invite with group
                $group->annotate("email_invitation", $invite_code, ACCESS_LOGGED_IN, $group->getGUID());
            }
            // make subject
            $subject = elgg_echo("group_tools:groups:invite:email:subject", array($group->name));
            // make body
            $body = elgg_echo("group_tools:groups:invite:email:body", array($loggedin_user->name, $group->name, $site->name, $text, $site->name, elgg_get_site_url() . "register", elgg_get_site_url() . "groups/invitations/?invitecode=" . $invite_code, $invite_code));
            $result = elgg_send_email($site_from, $email, $subject, $body);
        } else {
            $result = null;
        }
    }
    return $result;
}
开发者ID:remy40,项目名称:gvrs,代码行数:40,代码来源:functions.php

示例10: set_notifier

/**
 * create the notification script
 */
function set_notifier()
{
    unset_notifier();
    $dataroot = elgg_get_config('dataroot');
    $contents = file_get_contents(__DIR__ . '/lib/template.php');
    $emails = '';
    $email_string = elgg_get_plugin_setting('emails', PLUGIN_ID);
    if ($email_string) {
        $emails = array_unique(array_map('trim', explode("\n", $email_string)));
        foreach ($emails as $key => $e) {
            if (!is_email_address($e)) {
                unset($emails[$key]);
            }
            $emails[$key] = "'{$e}'";
        }
    }
    $contents = str_replace('{{emails}}', implode(', ', $emails), $contents);
    $html = elgg_get_plugin_setting('html', PLUGIN_ID);
    $file = elgg_get_config('dataroot') . NOTIFIER;
    file_put_contents($file, $contents);
    $file = elgg_get_config('dataroot') . HTML;
    file_put_contents($file, $html);
}
开发者ID:n8b,项目名称:VMN,代码行数:26,代码来源:start.php

示例11: engap_gettoken

function engap_gettoken($username, $password)
{
    //error_log("user".$username);
    if (is_email_address($username)) {
        $users = get_user_by_email($username);
        if (is_array($users) && count($users) == 1) {
            $user = $users[0];
            $username = $user->username;
        }
    } else {
        $user = get_user_by_username($username);
    }
    // validate username and password
    if ($user instanceof ELGGUser) {
        if (true === elgg_authenticate($username, $password)) {
            //expiry in minute
            //1 hour = 60
            //24 hours = 1440
            $token = create_user_token($username, 1440);
            //1 day
            if ($token) {
                $return['token'] = $token;
                $return['username'] = $user->username;
                $return['user_guid'] = $user->guid;
                $return['email'] = $user->email;
                $return['phone'] = $user->phone;
                $return['city'] = $user->city;
                $return['avatar_path'] = $user->getIconURL('large');
                $plugin = elgg_get_plugin_from_id("engap");
                $return['plugin_version'] = $plugin->getManifest()->getVersion();
                return $return;
            }
        }
    }
    throw new SecurityException(elgg_echo('SecurityException:authenticationfailed'));
}
开发者ID:enraiser,项目名称:engap,代码行数:36,代码来源:start.php

示例12: group_tools_invite_email

/**
 * Invite a new user by email to a group
 *
 * @param ElggGroup $group  the group to be invited for
 * @param string    $email  the email address to be invited
 * @param string    $text   (optional) extra text in the invitation
 * @param boolean   $resend should existing invitations be resend
 *
 * @return boolean|NULL true is invited, false on failure, null when already send
 */
function group_tools_invite_email(ElggGroup $group, $email, $text = "", $resend = false)
{
    $result = false;
    $loggedin_user = elgg_get_logged_in_user_entity();
    if (!empty($group) && $group instanceof ElggGroup && !empty($email) && is_email_address($email) && !empty($loggedin_user)) {
        // generate invite code
        $invite_code = group_tools_generate_email_invite_code($group->getGUID(), $email);
        if (!empty($invite_code)) {
            $found_group = group_tools_check_group_email_invitation($invite_code, $group->getGUID());
            if (empty($found_group) || $resend) {
                // make site email
                $site = elgg_get_site_entity();
                if (!empty($site->email)) {
                    if (!empty($site->name)) {
                        $site_from = $site->name . " <" . $site->email . ">";
                    } else {
                        $site_from = $site->email;
                    }
                } else {
                    // no site email, so make one up
                    if (!empty($site->name)) {
                        $site_from = $site->name . " <noreply@" . get_site_domain($site->getGUID()) . ">";
                    } else {
                        $site_from = "noreply@" . get_site_domain($site->getGUID());
                    }
                }
                if (empty($found_group)) {
                    // register invite with group
                    $group->annotate("email_invitation", $invite_code . "|" . $email, ACCESS_LOGGED_IN, $group->getGUID());
                }
                // make subject
                $subject = elgg_echo("group_tools:groups:invite:email:subject", array($group->name));
                // make body
                $body = elgg_echo("group_tools:groups:invite:email:body", array($loggedin_user->name, $group->name, $site->name, $text, $site->name, elgg_get_site_url() . "register?group_invitecode=" . $invite_code, elgg_get_site_url() . "groups/invitations/?invitecode=" . $invite_code, $invite_code));
                $params = array("group" => $group, "inviter" => $loggedin_user, "invitee" => $email);
                $body = elgg_trigger_plugin_hook("invite_notification", "group_tools", $params, $body);
                $result = elgg_send_email($site_from, $email, $subject, $body);
            } else {
                $result = null;
            }
        }
    }
    return $result;
}
开发者ID:pleio,项目名称:group_tools,代码行数:54,代码来源:functions.php

示例13: _elgg_set_user_email

/**
 * Set a user's email address
 * Returns null if no change is required or input is not present in the form
 * Returns true or false indicating success or failure if change was needed
 *
 * @return bool|void
 * @since 1.8.0
 * @access private
 */
function _elgg_set_user_email()
{
    $email = get_input('email');
    $user_guid = get_input('guid');
    if (!isset($email)) {
        return;
    }
    if ($user_guid) {
        $user = get_user($user_guid);
    } else {
        $user = elgg_get_logged_in_user_entity();
    }
    if (!is_email_address($email)) {
        register_error(elgg_echo('email:save:fail'));
        return false;
    }
    if (!$user instanceof ElggUser) {
        register_error(elgg_echo('email:save:fail'));
        return false;
    }
    if (strcmp($email, $user->email) === 0) {
        // no change
        return;
    }
    if (elgg_get_config('security_email_require_password') && $user->getGUID() === elgg_get_logged_in_user_guid()) {
        // validate password
        $pwd = get_input('email_password');
        $auth = elgg_authenticate($user->username, $pwd);
        if ($auth !== true) {
            register_error(elgg_echo('email:save:fail:password'));
            return false;
        }
    }
    if (!get_user_by_email($email)) {
        $user->email = $email;
        if ($user->save()) {
            system_message(elgg_echo('email:save:success'));
            return true;
        } else {
            register_error(elgg_echo('email:save:fail'));
        }
    } else {
        register_error(elgg_echo('registration:dupeemail'));
    }
    return false;
}
开发者ID:elgg,项目名称:elgg,代码行数:55,代码来源:user_settings.php

示例14: _ImportRecord

 /**
  * Imports an actual product record in to the database.
  *
  * @param array Array of record data
  */
 protected function _ImportRecord($record)
 {
     if (!$record['custconemail']) {
         $this->ImportSession['Results']['Failures'][] = implode(",", $record['original_record']) . " " . GetLang('ImportCustomersMissingEmail');
         return;
     }
     if (!is_email_address($record['custconemail'])) {
         $this->ImportSession['Results']['Failures'][] = implode(",", $record['original_record']) . " " . GetLang('ImportCustomersInvalidEmail');
         return;
     }
     $fillin = array('custconcompany', 'custconfirstname', 'custconlastname', 'custconphone');
     foreach ($fillin as $fillkey) {
         if (!isset($record[$fillkey])) {
             $record[$fillkey] = '';
         }
     }
     // Is there an existing customer with the same email?
     $customerId = 0;
     $existingFormSessionId = 0;
     $query = sprintf("select customerid from [|PREFIX|]customers where lower(custconemail)='%s'", $GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($record['custconemail'])));
     $result = $GLOBALS["ISC_CLASS_DB"]->Query($query);
     if ($row = $GLOBALS["ISC_CLASS_DB"]->Fetch($result)) {
         // Overriding existing products, set the product id
         if (isset($this->ImportSession['OverrideDuplicates']) && $this->ImportSession['OverrideDuplicates'] == 1) {
             $customerId = $row['customerid'];
             $this->ImportSession['Results']['Updates'][] = $record['custconfirstname'] . " " . $record['custconlastname'] . " (" . $record['custconemail'] . ")";
         } else {
             $this->ImportSession['Results']['Duplicates'][] = $record['custconfirstname'] . " " . $record['custconlastname'] . " (" . $record['custconemail'] . ")";
             return;
         }
         if (isId($row['custformsessionid'])) {
             $existingFormSessionId = $row['custformsessionid'];
         }
     }
     $customerData = array('company' => $record['custconcompany'], 'firstname' => $record['custconfirstname'], 'lastname' => $record['custconlastname'], 'email' => $record['custconemail'], 'phone' => $record['custconphone']);
     if (isset($record['custpassword']) && $record['custpassword'] !== '') {
         $customerData['password'] = $record['custpassword'];
     }
     if (isset($record['custstorecredit'])) {
         $customerData['storecredit'] = DefaultPriceFormat($record['custstorecredit']);
     }
     if (isId($customerId)) {
         $customerData['customerid'] = $customerId;
     }
     // Are we placing the customer in a customer group?
     $groupId = 0;
     if (!empty($record['custgroup'])) {
         static $customerGroups;
         $groupName = strtolower($record['custgroup']);
         if (isset($customerGroups[$groupName])) {
             $groupId = $customerGroups[$groupName];
         } else {
             $query = "\n\t\t\t\t\tSELECT customergroupid\n\t\t\t\t\tFROM [|PREFIX|]customer_groups\n\t\t\t\t\tWHERE LOWER(groupname)='" . $GLOBALS['ISC_CLASS_DB']->Quote($groupName) . "'\n\t\t\t\t";
             $groupId = $GLOBALS['ISC_CLASS_DB']->FetchOne($query, 'customergroupid');
             // Customer group doesn't exist, create it
             if (!$groupId) {
                 $newGroup = array('name' => $record['custgroup'], 'discount' => 0, 'isdefault' => 0, 'categoryaccesstype' => 'all');
                 $entity = new ISC_ENTITY_CUSTOMERGROUP();
                 $groupId = $entity->add($newGroup);
             }
             if ($groupId) {
                 $customerGroups[$groupName] = $groupId;
             }
         }
     }
     $customerData['customergroupid'] = $groupId;
     // Do we have a shipping address?
     $shippingData = array();
     if (isset($record['shipfullname']) || isset($record['shipfirstname']) || isset($record['shipaddress1']) || isset($record['shipaddress2']) || isset($record['shipcity']) || isset($record['shipstate']) || isset($record['shipzip']) || isset($record['shipcountry'])) {
         $fillin = array('shipaddress1', 'shipaddress2', 'shipcity', 'shipstate', 'shipzip', 'shipcountry');
         foreach ($fillin as $fillkey) {
             if (!isset($record[$fillkey])) {
                 $record[$fillkey] = '';
             }
         }
         $shippingData['shipfirstname'] = '';
         $shippingData['shiplastname'] = '';
         $shippingData['shipaddress1'] = $record['shipaddress1'];
         $shippingData['shipaddress2'] = $record['shipaddress2'];
         $shippingData['shipcity'] = $record['shipcity'];
         $shippingData['shipstate'] = $record['shipstate'];
         $shippingData['shipzip'] = $record['shipzip'];
         $shippingData['shipcountry'] = $record['shipcountry'];
         $shippingData['shipstateid'] = 0;
         $shippingData['shipcountryid'] = 0;
         $shippingData['shipdestination'] = '';
         // Find the country and state
         $shippingData['shipcountryid'] = (int) GetCountryByName($record['shipcountry']);
         if (!$shippingData['shipcountryid']) {
             $shippingData['shipcountryid'] = (int) GetCountryIdByISO2($record['shipcountry']);
         }
         // Still nothing? 0 for the shipping country ID
         if (!$shippingData['shipcountryid']) {
             $shippingData['shipcountryid'] = 0;
         }
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:class.batch.importer_29_3.php

示例15: validate_email_address

/**
 * Simple validation of a email.
 *
 * @param string $address
 * @throws RegistrationException on invalid
 * @return bool
 */
function validate_email_address($address)
{
    if (!is_email_address($address)) {
        throw new RegistrationException(elgg_echo('registration:notemail'));
    }
    // Got here, so lets try a hook (defaulting to ok)
    $result = true;
    return trigger_plugin_hook('registeruser:validate:email', 'all', array('email' => $address), $result);
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:16,代码来源:users.php


注:本文中的is_email_address函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。