/** * Set author User of this comment */ function set_author_User(&$author_User) { $this->author_User =& $author_User; $this->author_user_ID = $author_User->ID; parent::set_param('author_ID', 'number', $author_User->ID); }
/** * Set the full URL of the media folder * * @param string the full URL */ function set_media_url($url) { parent::set_param('media_url', 'string', trailing_slash($url)); }
/** * Set param value * * @param string Parameter name * @return boolean true, if a value has been set; false if it has not changed */ function set($parname, $parvalue) { global $Settings; switch ($parname) { case 'ID': case 'allowtrackbacks': case 'blog_in_bloglist': return parent::set_param($parname, 'number', $parvalue); break; case 'shortdesc': $this->shortdesc = $parvalue; return parent::set_param('description', 'string', $parvalue); break; default: return parent::set_param($parname, 'string', $parvalue); } }
/** * Set email address of the user. * * If the email address has changed and we're configured to invalidate the user in this case, * the user's account gets not active 'emaichanged' status here. * * @param string email address to set for the User * @param boolean Set TRUE if changing of account status is required * @return boolean true, if set; false if not changed */ function set_email($email, $change_status = true) { global $Settings; $r = parent::set_param('email', 'string', utf8_strtolower($email)); if ($change_status) { // Change user status to 'emailchanged' (if email has changed and Settings are available, which they are not during install): if ($r && $this->ID != 0 && isset($Settings) && $Settings->get('newusers_revalidate_emailchg') && $this->check_status('is_validated')) { // Deactivate the account, because the changed email has not been verified yet, but the user account is active: $this->set('status', 'emailchanged'); } } if (preg_match('#@(.+)#i', $email, $ematch)) { // Set email domain ID global $DB; $email_domain = $ematch[1]; $SQL = new SQL(); $SQL->SELECT('dom_ID'); $SQL->FROM('T_basedomains'); $SQL->WHERE('dom_type = \'email\''); $SQL->WHERE_and('dom_name = ' . $DB->quote($email_domain)); $dom_ID = $DB->get_var($SQL->get()); if (!$dom_ID) { // The email domains doesn't exist yet, Insert new record $DB->query('INSERT INTO T_basedomains ( dom_type, dom_name ) VALUES ( \'email\', ' . $DB->quote($email_domain) . ' )'); $dom_ID = $DB->insert_id; } $this->set('email_dom_ID', (int) $dom_ID); } return $r; }
/** * Set param value * * @param string Parameter name * @param mixed Parameter value * @return boolean true, if a value has been set; false if it has not changed */ function set($parname, $parvalue) { switch ($parname) { case 'perm_templates': return parent::set_param($parname, 'number', $parvalue); default: return parent::set_param($parname, 'string', $parvalue); } }
/** * Set param value * * @param string parameter name * @param mixed parameter value * @return boolean true, if a value has been set; false if it has not changed */ function set($parname, $parvalue) { $params = $this->get_param_definitions(NULL); if (isset($params[$parname])) { // This is a widget specific param: $this->param_array[$parname] = $parvalue; // This is what'll be saved to the DB: $this->set_param('params', 'string', serialize($this->param_array)); return; } switch ($parname) { default: return parent::set_param($parname, 'string', $parvalue); } }
/** * Set the spam karma, as a number. * @param integer Spam karma (-100 - 100) * @access protected */ function set_spam_karma($spam_karma) { return parent::set_param('spam_karma', 'number', $spam_karma); }
/** * Set email address of the user. * * If the email address has changed and we're configured to invalidate the user in this case, * the user's account gets invalidated here. * * @param string email address to set for the User * @return boolean true, if set; false if not changed */ function set_email($email) { global $Settings; $r = parent::set_param('email', 'string', $email); // Change "validated" status to false (if email has changed and Settings are available, which they are not during install): if ($r && isset($Settings) && $Settings->get('newusers_revalidate_emailchg')) { // In-validate account, because (changed) email has not been verified yet: parent::set_param('validated', 'number', 0); } return $r; }