From 62ebb00033e608d086e8814850606b7905f31c4b Mon Sep 17 00:00:00 2001 From: ikawhero Date: Wed, 15 Aug 2007 13:37:52 +0000 Subject: [PATCH] Additional settings for the custom profile fields --- user/profile/definelib.php | 6 +++++- user/profile/lib.php | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/user/profile/definelib.php b/user/profile/definelib.php index 60ff80baf2..8dc42977d6 100644 --- a/user/profile/definelib.php +++ b/user/profile/definelib.php @@ -38,6 +38,10 @@ class profile_define_base { $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) { } } -?> \ No newline at end of file +?> diff --git a/user/profile/lib.php b/user/profile/lib.php index bb0062776a..84ea1288ab 100644 --- a/user/profile/lib.php +++ b/user/profile/lib.php @@ -247,6 +247,23 @@ class profile_field_base { 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 -- 2.39.5