Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Additional settings for the custom profile fields

  • Loading branch information...
commit 62ebb00033e608d086e8814850606b7905f31c4b 1 parent a462602
ikawhero authored
Showing with 22 additions and 1 deletion.
  1. +5 −1 user/profile/definelib.php
  2. +17 −0 user/profile/lib.php
6 user/profile/definelib.php
View
@@ -38,6 +38,10 @@ function define_form_common(&$form) {
$form->addElement('selectyesno', 'locked', get_string('profilelocked', 'admin'));
+ $form->addElement('selectyesno', 'forceunique', get_string('profileforceunique', 'admin'));
+
+ $form->addElement('selectyesno', 'signup', get_string('profilesignup', 'admin'));
+
$choices = array();
$choices[PROFILE_VISIBLE_NONE] = get_string('profilevisiblenone', 'admin');
$choices[PROFILE_VISIBLE_PRIVATE] = get_string('profilevisibleprivate', 'admin');
@@ -470,4 +474,4 @@ function profile_edit_field($id, $datatype, $redirect) {
}
}
-?>
+?>
17 user/profile/lib.php
View
@@ -247,6 +247,23 @@ function is_locked() {
return (boolean)$this->field->locked;
}
+ /**
+ * Check if the field data should be unique
+ * @return boolean
+ */
+ function is_unique() {
+ return (boolean)$tihs->field->forceunique;
+ }
+
+ /**
+ * Check if the field should appear on the signup page
+ * @return boolean
+ */
+ function is_signup_field() {
+ return (boolean)$this->field->signup;
+ }
+
+
} /// End of class definition
Please sign in to comment.
Something went wrong with that request. Please try again.