You should have received a copy of the GNU General Public License along with earthli WebCore; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more information about the earthli WebCore, visit: http://www.earthli.com/software/webcore ****************************************************************************/ $Page->template_options->title = 'Contact'; $Page->title->subject = 'Contact'; $Page->location->add_root_link(); $Page->location->append('Contact'); $Page->start_display(); $res = $Page->resources(); $options = $Page->template_options; ?> <div class="main-box"> <p>To contact the site owners, use the <a href="<?php echo $res->resolve_file($options->support_url); ?> ">support page</a> or send an email to <em><?php echo scramble_email($Page->mail_options->webmaster_address); ?> </em>.</p> </div> <?php $Page->finish_display();
while ($file = readdir($h)) { if (strstr($file, ".gif")) { $flags[] = preg_replace("/\\.gif/", "", $file); } } closedir($h); sort($flags); $gBitSmarty->assign('flags', $flags); $editUser->mInfo['users_homepage'] = $editUser->getPreference('users_homepage', ''); $gBitSmarty->assign('editUser', $editUser); $gBitSmarty->assign('gContent', $editUser); // also assign to gContent to make services happy $gBitSmarty->assign('feedback', $feedback); /* This should come from BitDate->get_timezone_list but that seems to rely on a global from PEAR that does not exist. */ if (version_compare(phpversion(), "5.2.0", ">=")) { $user_timezones = DateTimeZone::listIdentifiers(); } else { for ($i = -12; $i <= 12; $i++) { $user_timezones[$i * 60 * 60] = $i; // Stored offset needs to be in seconds. } } $gBitSmarty->assign('userTimezones', $user_timezones); // email scrambling methods $scramblingMethods = array("n", "strtr", "unicode", "x"); $gBitSmarty->assignByRef('scramblingMethods', $scramblingMethods); $scramblingEmails = array(tra("no"), scramble_email($editUser->mInfo['email'], 'strtr'), scramble_email($editUser->mInfo['email'], 'unicode') . "-" . tra("unicode"), scramble_email($editUser->mInfo['email'], 'x')); $gBitSmarty->assignByRef('scramblingEmails', $scramblingEmails); // edit services $editUser->invokeServices('content_edit_function'); $gBitSystem->display('bitpackage:users/user_preferences.tpl', 'Edit User Preferences', array('display_mode' => 'display'));
/** * Return a description of the email. * This varies depending on {@link $email_visibility}. * @return string */ public function email_as_text() { if (!$this->email) { $Result = '[none]'; } else { switch ($this->email_visibility) { case User_email_hidden: $Result = '[hidden]'; break; case User_email_scrambled: $Result = scramble_email($this->email); break; case User_email_visible: $Result = $this->email; break; default: $Result = '[none]'; } } return $Result; }
/** * load - loads all settings & preferences for this user * * @param boolean $pFull Load additional user data like * @param string $pUserName User login name * @access public * @author Chrstian Fowler <*****@*****.**> * @return returnString */ function load($pFull = TRUE, $pUserName = NULL) { global $gBitSystem; $this->mInfo = NULL; if (isset($this->mUserId)) { $whereSql = "WHERE uu.`user_id`=?"; $bindVars = array($this->mUserId); } elseif (isset($this->mContentId)) { $whereSql = "WHERE uu.`content_id`=?"; $bindVars = array($this->mContentId); } elseif (!empty($pUserName)) { $whereSql = "WHERE uu.`login`=?"; $bindVars = array($pUserName); } if (isset($whereSql)) { $fullSelect = ''; $fullJoin = ''; if ($pFull) { $fullSelect = ' , lc.* '; $fullJoin = " LEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_content` lc ON ( uu.`content_id`=lc.`content_id` )"; $this->getServicesSql('content_load_sql_function', $fullSelect, $fullJoin, $whereSql, $bindVars); } // uu.`user_id` AS `uu_user_id` is last and aliases to avoid possible column name collisions $query = "\n\t\t\t\tSELECT uu.*,\n\t\t\t\t\t\tlf_ava.`file_name` AS `avatar_file_name`, la_ava.`attachment_id` AS `avatar_attachment_id`, lf_ava.`mime_type` AS `avatar_mime_type`,\n\t\t\t\t\t\tlf_por.`file_name` AS `portrait_file_name`, ta_por.`attachment_id` AS `portrait_attachment_id`, lf_por.`mime_type` AS `portrait_mime_type`,\n\t\t\t\t\t\tlf_logo.`file_name` AS `logo_file_name`, ta_logo.`attachment_id` AS `logo_attachment_id`, lf_logo.`mime_type` AS `logo_mime_type`\n\t\t\t\t\t {$fullSelect}, uu.`user_id` AS `uu_user_id`\n\t\t\t\tFROM `" . BIT_DB_PREFIX . "users_users` uu\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_attachments` la_ava ON ( uu.`avatar_attachment_id`=la_ava.`attachment_id` )\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_files` lf_ava ON ( lf_ava.`file_id`=la_ava.`foreign_id` )\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_attachments` ta_por ON ( uu.`portrait_attachment_id`=ta_por.`attachment_id` )\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_files` lf_por ON ( lf_por.`file_id`=ta_por.`foreign_id` )\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_attachments` ta_logo ON ( uu.`logo_attachment_id`=ta_logo.`attachment_id` )\n\t\t\t\t\tLEFT OUTER JOIN `" . BIT_DB_PREFIX . "liberty_files` lf_logo ON ( lf_logo.`file_id`=ta_logo.`foreign_id` )\n\t\t\t\t\t{$fullJoin}\n\t\t\t\t{$whereSql}"; if (($result = $this->mDb->query($query, $bindVars)) && $result->numRows()) { $this->mInfo = $result->fetchRow(); $this->mInfo['user'] = $this->mInfo['login']; $this->mInfo['valid'] = @$this->verifyId($this->mInfo['uu_user_id']); $this->mInfo['user_id'] = $this->mInfo['uu_user_id']; $this->mInfo['is_registered'] = $this->isRegistered(); foreach (array('portrait', 'avatar', 'logo') as $img) { $this->mInfo[$img . '_path'] = $this->getSourceFile(array('user_id' => $this->getField('user_id'), 'package' => liberty_mime_get_storage_sub_dir_name(array('mime_type' => $this->getField($img . '_mime_type'), 'name' => $this->getField($img . '_file_name'))), 'file_name' => basename($this->mInfo[$img . '_file_name']), 'sub_dir' => $this->getField($img . '_attachment_id'), 'mime_type' => $this->getField($img . '_mime_type'))); $this->mInfo[$img . '_url'] = liberty_fetch_thumbnail_url(array('source_file' => $this->mInfo[$img . '_path'], 'size' => 'small', 'mime_image' => FALSE)); } // break the real name into first and last name using the last space as the beginning of the last name // for people who really want to use first and last name fields if (preg_match('/ /', $this->mInfo['real_name'])) { $this->mInfo['first_name'] = substr($this->mInfo['real_name'], 0, strrpos($this->mInfo['real_name'], ' ')); $this->mInfo['last_name'] = substr($this->mInfo['real_name'], strrpos($this->mInfo['real_name'], ' ') + 1); } else { // no spaces assign the real name to the first name $this->mInfo['first_name'] = $this->mInfo['real_name']; } $this->mUserId = $this->mInfo['uu_user_id']; $this->mContentId = $this->mInfo['content_id']; $this->mUsername = $this->mInfo['login']; // a few random security conscious unset's - SPIDER unset($this->mInfo['user_password']); unset($this->mInfo['hash']); $this->loadPreferences(); // Load attachments LibertyMime::load(); if ($this->getPreference('users_country')) { $this->setPreference('flag', $this->getPreference('users_country')); $this->setPreference('users_country', str_replace('_', ' ', $this->getPreference('users_country'))); } if ($pFull) { $this->mInfo['real_name'] = trim($this->mInfo['real_name']); $this->mInfo['display_name'] = !empty($this->mInfo['real_name']) ? $this->mInfo['real_name'] : (!empty($this->mUsername) ? $this->mUsername : (!empty($this->mInfo['email']) ? substr($this->mInfo['email'], 0, strpos($this->mInfo['email'], '@')) : $this->mUserId)); //print("displayName: ".$this->mInfo['display_name']); $this->defaults(); $this->mInfo['publicEmail'] = scramble_email($this->mInfo['email'], $this->getPreference('users_email_display') ? $this->getPreference('users_email_display') : NULL); } $this->mTicket = substr(md5(session_id() . $this->mUserId), 0, 20); } else { $this->mUserId = NULL; } } if (!$gBitSystem->isFeatureActive('i18n_browser_languages')) { global $gBitLanguage, $gBitUser; //change language only if if logged user is this user //otherwise it's just logged user (lang A) watching other user's page (lang B) and don't change if ($this->mUserId && $this->mUserId != ANONYMOUS_USER_ID && $gBitUser === $this) { $gBitLanguage->mLanguage = $this->getPreference('bitlanguage', $gBitLanguage->mLanguage); } elseif (isset($_SESSION['bitlanguage'])) { // users not logged that change the preference $gBitLanguage->mLanguage = $_SESSION['bitlanguage']; } } return $this->isValid(); }