Browse Source

[svn r15661] phone number field missing during registration (see FS#2639)

Julio Montoya 16 years ago
parent
commit
0827342cbd

+ 22 - 4
main/auth/inscription.php

@@ -1,10 +1,10 @@
 <?php
-// $Id: inscription.php 14212 2008-01-31 02:09:57Z yannoo $
+// $Id: inscription.php 15661 2008-06-30 20:57:38Z juliomontoya $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
 
-	Copyright (c) 2004 Dokeos S.A.
+	Copyright (c) 2004 Dokeos SPRL
 	Copyright (c) 2003 Ghent University (UGent)
 	Copyright (c) 2001 Universite catholique de Louvain (UCL)
 	Copyright (c) various contributors
@@ -20,7 +20,8 @@
 
 	See the GNU General Public License for more details.
 
-	Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
+	Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
+	Mail: info@dokeos.com
 ==============================================================================
 */
 /**
@@ -97,6 +98,12 @@ $form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required');
 $form->addRule(array('pass1', 'pass2'), get_lang('PassTwo'), 'compare');
 if (CHECK_PASS_EASY_TO_FIND)
 	$form->addRule('password1', get_lang('PassTooEasy').': '.api_generate_password(), 'callback', 'api_check_password');
+
+//	PHONE
+$form->addElement('text', 'phone', get_lang('Phone'), array('size' => 40));
+if (api_get_setting('registration', 'phone') == 'true')
+	$form->addRule('phone', get_lang('ThisFieldIsRequired'), 'required');
+
 //	LANGUAGE
 if (get_setting('registration', 'language') == 'true')
 {
@@ -108,6 +115,11 @@ if (get_setting('allow_registration_as_teacher') <> 'false')
 	$form->addElement('radio', 'status', get_lang('Status'), get_lang('RegStudent'), STUDENT);
 	$form->addElement('radio', 'status', null, get_lang('RegAdmin'), COURSEMANAGER);
 }
+
+
+
+
+
 //	EXTENDED FIELDS
 if (api_get_setting('extended_profile') == 'true' AND api_get_setting('extendedprofile_registration','mycomptetences') == 'true')
 {
@@ -162,6 +174,12 @@ if(!empty($_GET['email']))
 {
 	$defaults['email'] = Security::remove_XSS($_GET['email']);
 }
+
+if(!empty($_GET['phone']))
+{
+	$defaults['phone'] = Security::remove_XSS($_GET['phone']);
+}
+
 if (api_get_setting('openid_authentication')=='true' && !empty($_GET['openid']))
 {
 	$defaults['openid'] = Security::remove_XSS($_GET['openid']);	
@@ -183,7 +201,7 @@ if ($form->validate())
 	}
 
 	// creating a new user
-	$user_id = UserManager::create_user($values['firstname'],$values['lastname'],$values['status'],$values['email'],$values['username'],$values['pass1'],$values['official_code'], $values['language']);
+	$user_id = UserManager::create_user($values['firstname'],$values['lastname'],$values['status'],$values['email'],$values['username'],$values['pass1'],$values['official_code'], $values['language'],$values['phone']);
 
 
 

+ 3 - 1
main/install/dokeos_main.sql

@@ -558,7 +558,9 @@ VALUES
 ('extendedprofile_registrationrequired', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyDiplomas'),
 ('extendedprofile_registrationrequired', 'myteach', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyTeach'),
 ('extendedprofile_registrationrequired', 'mypersonalopenarea', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyPersonalOpenArea'),
-('ldap_filled_tutor_field_value', NULL, 'textfield', 'LDAP', '', 'LDAPFilledTutorFieldValueTitle', 'LDAPFilledTutorFieldValueComment', NULL, '');
+('ldap_filled_tutor_field_value', NULL, 'textfield', 'LDAP', '', 'LDAPFilledTutorFieldValueTitle', 'LDAPFilledTutorFieldValueComment', NULL, ''),
+('registration','phone','textfield','User','false','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Phone');
+
 
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;

+ 1 - 1
main/install/migrate-db-1.8.5-1.8.6-pre.sql

@@ -12,7 +12,7 @@
 --
 -- This first part is for the main database
 -- xxMAINxx
-
+INSERT INTO settings_current (variable, subkey,type,category,selected_value,title,comment,scope,subkeytext)VALUES ('registration', 'phone', 'textfield', 'User', 'false', 'RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment', NULL, 'Phone');
 
 -- xxSTATSxx