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


PHP Contacts::validateUser方法代码示例

本文整理汇总了PHP中Contacts::validateUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Contacts::validateUser方法的具体用法?PHP Contacts::validateUser怎么用?PHP Contacts::validateUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contacts的用法示例。


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

示例1: createUserFromContactForm

	private function createUserFromContactForm ($user, $contactId, $email, $sendEmail = true) {
		$createUser = false;
		$createPass = false;

		if ( array_var ($user, 'create-user')) {
			$createUser = true;
			if ( array_var ($user, 'create-password') || !$sendEmail) { 
				$createPass = true;
				$password =  array_var($user, 'password');
				$password_a =  array_var($user, 'password_a');
			}
			$type =  array_var($user, 'type');
			$username =  array_var($user, 'username');
		}
		if ($createUser){
			if ($createPass){
				$userData = array(
					'contact_id' => $contactId,
					'username' => $username,
					'email' => $email,
					'password' => $password,
					'password_a' => $password_a,
					'type' => $type,
					'password_generator' => 'specify',
					'send_email_notification' => $sendEmail
				);
			}else{
				$userData = array(
					'contact_id' => $contactId,
					'username' => $username,
					'email' => $email,
					'type' => $type,
					'password_generator' => 'link',
					'send_email_notification' => $sendEmail
				);
			}
			$valid =  Contacts::validateUser($contactId);
			create_user($userData, '');
		}
		
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:41,代码来源:ContactController.class.php

示例2: createUserFromContactForm

 private function createUserFromContactForm($user, $contactId, $email, $sendEmail = true, $save_permissions = true)
 {
     $createUser = false;
     $createPass = false;
     if (array_var($user, 'create-user')) {
         $createUser = true;
         if (array_var($user, 'create-password') || !$sendEmail) {
             $createPass = true;
             $password = array_var($user, 'password');
             $password_a = array_var($user, 'password_a');
         }
         $type = array_var($user, 'type');
         $username = array_var($user, 'username');
     }
     if ($createUser) {
         if ($createPass) {
             $userData = array('contact_id' => $contactId, 'username' => $username, 'email' => $email, 'password' => $password, 'password_a' => $password_a, 'type' => $type, 'password_generator' => 'specify', 'send_email_notification' => $sendEmail);
         } else {
             $userData = array('contact_id' => $contactId, 'username' => $username, 'email' => $email, 'type' => $type, 'password_generator' => 'link', 'send_email_notification' => $sendEmail);
         }
         $valid = Contacts::validateUser($contactId);
         // root permissions
         if ($rp_genid = array_var($_POST, 'root_perm_genid')) {
             $rp_permissions_data = array();
             foreach ($_POST as $name => $value) {
                 if (str_starts_with($name, $rp_genid . 'rg_root_')) {
                     $rp_permissions_data[$name] = $value;
                 }
             }
         }
         create_user($userData, array_var($_REQUEST, 'permissions', ''), $rp_permissions_data, $save_permissions);
     }
     return $userData;
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:34,代码来源:ContactController.class.php


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