本文整理汇总了PHP中vRequest::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::getEmail方法的具体用法?PHP vRequest::getEmail怎么用?PHP vRequest::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vRequest
的用法示例。
在下文中一共展示了vRequest::getEmail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Bind the post data to the JUser object and the VM tables, then saves it
* It is used to register new users
* This function can also change already registered users, this is important when a registered user changes his email within the checkout.
*
* @author Max Milbers
* @author Oscar van Eijk
* @return boolean True is the save was successful, false otherwise.
*/
public function store(&$data)
{
$message = '';
vRequest::vmCheckToken('Invalid Token, while trying to save user');
if (empty($data)) {
vmError('Developer notice, no data to store for user');
return false;
}
//To find out, if we have to register a new user, we take a look on the id of the usermodel object.
//The constructor sets automatically the right id.
$new = false;
if (empty($this->_id) or $this->_id < 1) {
$new = true;
$user = new JUser();
//thealmega http://forum.tsmart.net/index.php?topic=99755.msg393758#msg393758
} else {
$cUser = JFactory::getUser();
if (!vmAccess::manager('user.edit') and $cUser->id != $this->_id) {
vmWarn('Insufficient permission');
return false;
}
$user = JFactory::getUser($this->_id);
}
$gid = $user->get('gid');
// Save original gid
// Preformat and control user datas by plugin
JPluginHelper::importPlugin('vmuserfield');
$dispatcher = JDispatcher::getInstance();
$valid = true;
$dispatcher->trigger('plgVmOnBeforeUserfieldDataSave', array(&$valid, $this->_id, &$data, $user));
// $valid must be false if plugin detect an error
if (!$valid) {
return false;
}
// Before I used this "if($cart && !$new)"
// This construction is necessary, because this function is used to register a new JUser, so we need all the JUser data in $data.
// On the other hand this function is also used just for updating JUser data, like the email for the BT address. In this case the
// name, username, password and so on is already stored in the JUser and dont need to be entered again.
if (empty($data['email'])) {
$email = $user->get('email');
if (!empty($email)) {
$data['email'] = $email;
}
} else {
$data['email'] = vRequest::getEmail('email', '');
}
//$data['email'] = str_replace(array('\'','"',',','%','*','/','\\','?','^','`','{','}','|','~'),array(''),$data['email']);
//This is important, when a user changes his email address from the cart,
//that means using view user layout edit_address (which is called from the cart)
$user->set('email', $data['email']);
if (empty($data['name'])) {
$name = $user->get('name');
if (!empty($name)) {
$data['name'] = $name;
}
} else {
$data['name'] = vRequest::getWord('name', '');
}
$data['name'] = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $data['name']);
if (empty($data['username'])) {
$username = $user->get('username');
if (!empty($username)) {
$data['username'] = $username;
} else {
$data['username'] = vRequest::getWord('username', '');
}
}
if (empty($data['password'])) {
$data['password'] = vRequest::getCmd('password', '');
if ($data['password'] != vRequest::get('password')) {
vmError('Password contained invalid character combination.');
return false;
}
}
if (empty($data['password2'])) {
$data['password2'] = vRequest::getCmd('password2');
if ($data['password2'] != vRequest::get('password2')) {
vmError('Password2 contained invalid character combination.');
return false;
}
}
if (!$new and empty($data['password2'])) {
unset($data['password']);
unset($data['password2']);
}
if (!vmAccess::manager('core')) {
$whiteDataToBind = array();
if (isset($data['name'])) {
$whiteDataToBind['name'] = $data['name'];
}
if (isset($data['username'])) {
//.........这里部分代码省略.........
示例2: updateCartWithKlarnacheckoutAddress
function updateCartWithKlarnacheckoutAddress()
{
if (!class_exists('VirtueMartCart')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'cart.php';
}
$cart = VirtueMartCart::getCart();
$updated = false;
$zip = vRequest::getWord('zip', '');
$email = vRequest::getEmail('email', '');
$first_name = vRequest::getWord('given_name', '');
$last_name = vRequest::getWord('family_name', '');
if ($zip) {
$cart->BT['zip'] = $zip;
$updated = true;
}
if ($email) {
$cart->BT['email'] = $email;
$updated = true;
}
if ($first_name) {
$cart->BT['first_name'] = $first_name;
$updated = true;
}
if ($last_name) {
$cart->BT['last_name'] = $last_name;
$updated = true;
}
if (!$updated) {
return $updated;
}
$cart->setCartIntoSession();
return $updated;
}
示例3: renderMailLayout
function renderMailLayout () {
$this->setLayout ('mail_html_question');
$this->comment = vRequest::getString ('comment');
$this->user = JFactory::getUser ();
if (empty($this->user->id)) {
$fromMail = vRequest::getEmail ('email'); //is sanitized then
$fromName = vRequest::getVar ('name', ''); //is sanitized then
//$fromMail = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
$this->user->email = $fromMail;
$this->user->name = $fromName;
}
$virtuemart_product_id = vRequest::getInt ('virtuemart_product_id', 0);
$productModel = VmModel::getModel ('product');
if(empty($this->product)){
$this->product = $productModel->getProduct ($virtuemart_product_id);
}
$productModel->addImages($this->product);
$this->subject = vmText::_ ('COM_VIRTUEMART_QUESTION_ABOUT') . $this->product->product_name;
$vendorModel = VmModel::getModel ('vendor');
$this->vendor = $vendorModel->getVendor ($this->product->virtuemart_vendor_id);
$this->vendor->vendor_store_name = $fromName;
$vendorModel->addImages ($this->vendor);
$this->vendorEmail = $vendorModel->getVendorEmail($this->vendor->virtuemart_vendor_id);;
// in this particular case, overwrite the value for fix the recipient name
$this->vendor->vendor_name = $this->user->get('name');
if (VmConfig::get ('order_mail_html')) {
$tpl = 'mail_html_question';
} else {
$tpl = 'mail_raw_question';
}
$this->setLayout ($tpl);
$this->isMail = true;
parent::display ();
}