/** * displayHeader * * @return void */ function displayHeader() { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => getSiteName(), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Members'), 'pageId' => 'members', 'path' => URL_PREFIX, 'displayname' => $this->fcmsUser->displayName, 'version' => getCurrentVersion(), 'year' => date('Y')); displayPageHeader($params); $order = isset($_GET['order']) ? $_GET['order'] : 'alphabetical'; $alpha = $age = $part = $act = $join = ''; if ($order == 'alphabetical') { $alpha = 'class="selected"'; } elseif ($order == 'age') { $age = 'class="selected"'; } elseif ($order == 'participation') { $part = 'class="selected"'; } elseif ($order == 'activity') { $act = 'class="selected"'; } elseif ($order == 'joined') { $join = 'class="selected"'; } echo ' <div id="leftcolumn"> <h3>' . T_('Views') . '</h3> <ul> <li ' . $alpha . '><a href="?order=alphabetical">' . T_('Alphabetical') . '</a></li> <li ' . $age . '><a href="?order=age">' . T_('Age') . '</a></li> <li ' . $part . '><a href="?order=participation">' . T_('Participation') . '</a></li> <li ' . $act . '><a href="?order=activity">' . T_('Last Seen') . '</a></li> <li ' . $join . '><a href="?order=joined">' . T_('Joined') . '</a></li> </ul> </div> <div id="maincolumn">'; }
function __construct() { $guid = getInput("guid"); $reply = getInput("reply"); if (!$reply) { new SystemMessage("Message body cannot be left empty."); forward(); } $message = getEntity($guid); $to = getLoggedInUserGuid() == $message->to ? $message->from : $message->to; $from = getLoggedInUserGuid(); $to_user = getEntity($to); $from_user = getEntity($from); $message_element = new Messageelement(); $message_element->message = $reply; $message_element->to = $to; $message_element->from = $from; $message_element->container_guid = $guid; $message_element->save(); $link = getSiteURL() . "messages"; notifyUser("message", $to, getLoggedInUserGuid(), $to); sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true)); new SystemMessage("Your message has been sent."); forward("messages/" . $message->guid); }
/** * Constructor * * @return void */ public function __construct($fcmsError, $fcmsDatabase, $fcmsUser) { $this->fcmsError = $fcmsError; $this->fcmsDatabase = $fcmsDatabase; $this->fcmsUser = $fcmsUser; $this->fcmsTemplate = array('sitename' => cleanOutput(getSiteName()), 'nav-link' => getAdminNavLinks(), 'pagetitle' => T_('Administration: YouTube'), 'path' => URL_PREFIX, 'displayname' => $fcmsUser->displayName, 'version' => getCurrentVersion(), 'year' => date('Y')); $this->control(); }
function action($data = array(), $post = array(), $id) { $ci =& get_instance(); $ci->load->library('session'); if (isset($this->ini['sandbox']) && isset($this->ini['api_login_id']) && isset($this->ini['transaction_key']) && isset($post['card_num']) && isset($post['exp_date'])) { require dirname(__FILE__) . '/lib/shared/AuthorizeNetRequest.php'; require dirname(__FILE__) . '/lib/shared/AuthorizeNetTypes.php'; require dirname(__FILE__) . '/lib/shared/AuthorizeNetXMLResponse.php'; require dirname(__FILE__) . '/lib/shared/AuthorizeNetResponse.php'; require dirname(__FILE__) . '/lib/AuthorizeNetAIM.php'; define("AUTHORIZENET_API_LOGIN_ID", $this->ini['api_login_id']); define("AUTHORIZENET_TRANSACTION_KEY", $this->ini['transaction_key']); define("AUTHORIZENET_SANDBOX", $this->ini['sandbox']); $sale = new AuthorizeNetAIM(); $sale->amount = number_format($data['amount'], 2); $sale->card_num = $post['card_num']; $sale->exp_date = $post['exp_date']; $response = $sale->authorizeAndCapture(); if ($response->approved) { $ci =& get_instance(); $ci->load->model('order_m'); $order = $ci->order_m->getOrderNumber($data['item_number']); if (count($order) > 0) { $update['status'] = 'completed'; $updatehis['order_id'] = $order->id; $updatehis['label'] = 'order_status'; $updatehis['content'] = json_encode(array($order->order_number => 'completed')); $updatehis['date'] = date('Y-m-d H:i:s'); $ci->order_m->_table_name = 'orders'; if ($ci->order_m->save($update, $order->id)) { $ci->order_m->_table_name = 'orders_histories'; $ci->order_m->save($updatehis); $ci->load->helper('cms'); $user = $ci->session->userdata('user'); //params shortcode email. $params = array('username' => $user['username'], 'email' => $user['email'], 'date' => date('Y-m-d H:i:s'), 'shop' => getSiteName(config_item('site_name')), 'shop_url' => site_url(), 'total' => number_format($data['amount'], 2), 'order_number' => $data['item_number'], 'status' => 'completed'); //config email. $config = array('mailtype' => 'html'); $subject = configEmail('sub_order_status', $params); $message = configEmail('order_status', $params); $ci->load->library('email', $config); $ci->email->from(getEmail(config_item('admin_email')), getSiteName(config_item('site_name'))); $ci->email->to($user['email']); $ci->email->subject($subject); $ci->email->message($message); $ci->email->send(); } } $ci->session->set_flashdata('msg', 'Thanks you for payment!'); if (isset($this->ini['message'])) { $ci->session->set_flashdata('message', $this->ini['message']); } } else { $ci->session->set_flashdata('error', 'Your payment not success!'); } } redirect(site_url('payment/confirm')); }
/** * displayHeader * * Displays the header of the page, including the leftcolumn navigation. * * @return void */ function displayHeader() { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => cleanOutput(getSiteName()), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Polls'), 'pageId' => 'poll', 'path' => URL_PREFIX, 'displayname' => $this->fcmsUser->displayName, 'version' => getCurrentVersion(), 'year' => date('Y')); displayPageHeader($params); $navParams = array('navigation' => array(array('url' => 'polls.php', 'textLink' => T_('Latest')), array('url' => 'polls.php?action=pastpolls', 'textLink' => T_('Past Polls')))); if ($this->fcmsUser->access < 2) { $navParams['actions'] = array(array('url' => 'admin/polls.php', 'textLink' => T_('Administrate'))); } loadTemplate('global', 'page-navigation', $navParams); }
/** * getEmailHeaders * * @param string $name * @param string $email * * @return string */ function getEmailHeaders($name = '', $email = '') { if (empty($name)) { $name = getSiteName(); } if (empty($email)) { $email = getContactEmail(); } return "From: {$name} <{$email}>\r\n" . "Reply-To: {$email}\r\n" . "Content-Type: text/plain; charset=UTF-8;\r\n" . "MIME-Version: 1.0\r\n" . "X-Mailer: PHP/" . phpversion(); }
/** * displayHeader * * @return void */ function displayHeader() { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => getSiteName(), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Notifications'), 'pageId' => 'notifications', 'path' => URL_PREFIX, 'displayname' => $this->fcmsUser->displayName, 'version' => getCurrentVersion(), 'year' => date('Y')); $params['javascript'] = ' <script type="text/javascript"> $(document).ready(function() { initChatBar(\'' . T_('Chat') . '\', \'' . URL_PREFIX . '\'); }); </script>'; loadTemplate('global', 'header', $params); }
public function __construct() { gateKeeper(); $email_users = array(); $container_guid = getInput("container_guid"); $topic = getEntity($container_guid); $category_guid = $topic->container_guid; $category = getEntity($category_guid); $description = getInput("comment"); $comment = new Forumcomment(); $comment->description = $description; $comment->container_guid = $container_guid; $comment->category_guid = $category_guid; $comment->owner_guid = getLoggedInUserGuid(); $comment->save(); new SystemMessage("Your comment has been posted."); new Activity(getLoggedInUserGuid(), "forum:comment:posted", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $topic->getURL(), $topic->title, truncate($comment->description)), $container_guid, $category->access_id); $all_comments = getEntities(array("type" => "Forumcomment", "metadata_name" => "container_guid", "metadata_value" => $container_guid)); $notify_users = array($topic->owner_guid); $container_owner_guid = $topic->owner_guid; $container_owner = getEntity($container_owner_guid); if ($container_owner->notify_when_forum_comment_topic_i_own == "email" || $container_owner->notify_when_forum_comment_topic_i_own == "both") { $email_users[] = $container_guid; } foreach ($all_comments as $comment) { $user_guid = $comment->owner_guid; $user = getEntity($user_guid); switch ($user->notify_when_forum_comment_topic_i_own) { case "both": $notify_users[] = $comment->owner_guid; $email_users[] = $comment->owner_guid; break; case "email": $email_users[] = $comment->owner_guid; break; case "site": $notify_users[] = $comment->owner_guid; break; case "none": break; } } $notify_users = array_unique($notify_users); foreach ($notify_users as $user_guid) { notifyUser("forumcomment", $container_guid, getLoggedInUserGuid(), $user_guid); } foreach ($email_users as $user) { $params = array("to" => array($user->full_name, $user->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment. Click <a href='{$url}'>Here</a> to view it.", "html" => true); sendEmail($params); } forward(); }
public function __construct($data = NULL) { gateKeeper(); $logged_in_user = getLoggedInUser(); if (!$data) { // Get the comment body $comment_body = getInput("comment"); // Get container url $container_guid = getInput("guid"); } else { $comment_body = $data['comment_body']; $container_guid = $data['container_guid']; } $container = getEntity($container_guid); $container_owner_guid = $container->owner_guid; if ($container_owner_guid) { $container_owner = getEntity($container_owner_guid); } $url = $container->getURL(); if (!$url) { $url = getSiteURL(); } // Create the comment CommentsPlugin::createComment($container_guid, $comment_body); if ($container_owner_guid) { if ($container_owner_guid != getLoggedInUserGuid()) { $params = array("to" => array($container_owner->full_name, $container_owner->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment. Click <a href='{$url}'>Here</a> to view it.", "html" => true); switch ($logged_in_user->getSetting("notify_when_comment")) { case "email": sendEmail($params); break; case "none": break; case "site": notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid); break; case "both": sendEmail($params); notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid); break; } } } runHook("add:comment:after"); if (getLoggedInUserGuid() != $container_owner_guid && $container_owner_guid) { new Activity(getLoggedInUserGuid(), "activity:comment", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container_owner->getURL(), $container_owner->full_name, $container->getURL(), translate($container->type), truncate($comment_body))); } elseif (!$container_owner_guid) { new Activity(getLoggedInUserGuid(), "activity:comment:own", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container->getURL(), $container->title, translate($container->type), truncate($comment_body))); } // Return to container page. forward(); }
static function sendVerificationEmail($user) { if ($user->verified == "true") { return false; } $user->email_verification_code = randString(70); $user->save(); if (sendEmail(array("from" => array("email" => getSiteEmail(), "name" => getSiteName()), "to" => array("email" => $user->email, "name" => $user->first_name . " " . $user->last_name), "subject" => display("email/verify_email_subject", array("user_guid" => $user->guid)), "body" => display("email/verify_email_body", array("user_guid" => $user->guid))))) { return true; } $user->email_verification_code = NULL; $user->save(); return false; }
public function termSearchByUrl(Request $request) { $url = $request['url']; $connection = getSiteName(getDomain($url)); $path_alias = getUri($url); if (empty($connection) || empty($path_alias)) { return AJAX::argumentError(); } $termModule = new TermModule($connection); $result = $termModule->getTermInfo(array('path_alias' => $path_alias)); if (count($result) > 0) { return AJAX::success(array('info' => $result)); } else { return AJAX::notExist(); } }
public function productSearchByURL(Request $request) { $url = $request['url']; $connection = getSiteName(getDomain($url)); $sn = getSn($url); if (empty($connection) || empty($sn)) { return AJAX::argumentError(); } $termModule = new ProductModule($connection); $result = $termModule->getProductInfo(array('sn' => $sn)); if (count($result) > 0) { return AJAX::success(array('info' => $result)); } else { return AJAX::notExist(); } }
function __construct() { gateKeeper(); $to = getInput("to"); $from = getLoggedInUserGuid(); $subject = getInput("subject"); $message_body = getInput("message"); if (!$message_body) { new SystemMessage("Message body cannot be left blank."); forward(); } // Make sure recipient is a user $to_user = getEntity($to); classGateKeeper($to_user, "User"); // Make sure logged in user and to user are friends if (!FriendsPlugin::friends(getLoggedInUserGuid(), $to)) { forward(); } // Create a new message $message = new Message(); $message->to = $to; $message->from = $from; $message->subject = $subject; $message->save(); $message_element = new Messageelement(); $message_element->to = $to; $message_element->from = $from; $message_element->subject = $subject; $message_element->message = $message_body; $message_element->container_guid = $message->guid; $message_element->save(); $link = getSiteURL() . "messages"; $notify = $to_user->notify_when_message; if (!$notify) { $notify = "both"; } if ($notify == "both" || $notify == "site") { notifyUser("message", $to, $from, $to); } if ($notify == "both" || ($notify = "email")) { sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true)); } new SystemMessage("Your message has been sent."); forward(); }
/** * displayHeader * * @return void */ function displayHeader() { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => getSiteName(), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Help'), 'pageId' => 'help', 'path' => URL_PREFIX, 'displayname' => getUserDisplayName($this->fcmsUser->id), 'version' => getCurrentVersion()); displayPageHeader($params); echo ' <div id="leftcolumn"> <h3>' . T_('Topics') . '</h3> <ul class="menu"> <li><a href="?topic=photo">' . T_('Photo Gallery') . '</a></li> <li><a href="?topic=video">' . T_('Video Gallery') . '</a></li> <li><a href="?topic=settings">' . T_('Personal Settings') . '</a></li> <li><a href="?topic=address">' . T_('Address Book') . '</a></li> <li><a href="?topic=admin">' . T_('Administration') . '</a></li> </ul> </div> <div id="maincolumn">'; }
/** * displayHeader * * @return void */ function displayHeader() { echo ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '"> <head> <title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title> <script type="text/javascript" src="ui/js/jquery.js"></script> <script type="text/javascript" src="ui/js/fcms.js"></script> <link rel="stylesheet" type="text/css" href="ui/css/fcms-core.css" /> <script type="text/javascript"> $(document).ready(function() { initAttendingEvent(); }); </script> </head> <body id="invitation" class="clearfix"> <img id="logo" src="ui/img/logo.gif" alt="' . getSiteName() . '"/>'; }
public function __construct() { new CSS("videos", getSitePath() . "core_plugins/videos/vendor/mediaelement/build/mediaelementplayer.css"); new FooterJS("video", getSiteURL() . "core_plugins/videos/assets/js/video.js", 5001, true); new FooterJS("video_player", getSiteURL() . "core_plugins/videos/vendor/mediaelement/build/mediaelement-and-player.min.js", 5000); new StorageType("Video", "description", "text"); new StorageType("Video", "url", "text"); new StorageType("Videoalbum", "description", "text"); new StorageType("Videoalbum", "icon_filename", "text"); new ViewExtension("header:after", "page_elements/video_selector"); new ViewExtension("page_elements/site_js", "videos/video_footer"); new ViewExtension("profile/right", "videos/profile"); new ViewExtension("tinymce/buttons", "videos/tinymce_button"); new Hook("cron:minute", "VideoConvertHook"); new Admintab("video_settings", 1000, array()); new Setting("allow_video_uploads", "dropdown", array("no" => "No", "yes" => "Yes"), "video_settings"); new Setting("ffmpeg_ffmprobe_executable_path", "text", array(), "video_settings", shell_exec("which ffmpeg")); new Metatag("Video", "title", getSiteName() . " | Videos"); new MenuItem(array("name" => "videos", "href" => "videos", "label" => "Videos", "menu" => "header_left", "list_class" => "visible-xs hidden-sm visible-md visible-lg")); new MenuItem(array("name" => "videos2", "href" => "videos", "label" => "Videos", "menu" => "tools", "page" => "videos")); }
public function __construct() { new CSS("photo", getSitePath() . "core_plugins/photos/assets/css/photos.css"); new StorageType("Photo", "description", "text"); new StorageType("Photoalbum", "description", "text"); new StorageType("Photoalbum", "icon_filename", "text"); new FooterJS("photo", getSiteURL() . "core_plugins/photos/assets/js/photo.js", 5000, true); new ViewExtension("header:after", "page_elements/photo_selector"); new ViewExtension("profile/middle", "photos/profile"); new ViewExtension('pages/home_stats', "pages/photo_stats"); new ViewExtension("page_elements/site_js", "photos/photo_footer"); new ViewExtension("tinymce/buttons", "photos/tinymce_button"); if (isEnabledPlugin("groups")) { new ViewExtension("groups/right", "photos/group_photos"); } else { removeViewExtension("groups/right", "photos/group_photos"); } new Metatag("Photo", "title", getSiteName() . " | Photos"); new MenuItem(array("name" => "photos", "href" => "photos", "label" => "Photos", "menu" => "header_left", "list_class" => "visible-xs hidden-sm visible-md visible-lg")); new MenuItem(array("name" => "photos2", "href" => "photos", "label" => "Photos", "menu" => "tools", "page" => "photos")); }
/** * displayHeader * * @return void */ function displayHeader() { echo ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '"> <head> <title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="author" content="Ryan Haudenschilt" /> <link rel="stylesheet" type="text/css" href="' . URL_PREFIX . 'ui/themes/default/style.css"/> <link rel="shortcut icon" href="' . URL_PREFIX . 'ui/themes/favicon.ico"/>'; // TODO // Move css to fcms-core echo ' <style type="text/css"> html { background: #fff; } body { width: 600px; margin: 0; padding: 20px; text-align: left; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 11px; border: none; background: #fff; } form div, form { display: inline; } td.n { padding: 2px; text-align: right; width: 75px; } td.v { text-align: center; width: 30px; } td.file { padding: 0 5px; text-align: left; width: 150px; } tr.alt { background-color: #f4f4f4; } .delbtn, .viewbtn { padding: 0 } </style> <script type="text/javascript"> //<![CDATA[ function insertUpImage(str) { var textarea = window.opener.document.getElementById(\'post\'); if (textarea) { if (textarea.value == "message") { textarea.value = str + " "; } else { textarea.value += str + " "; } textarea.focus(); } javascript:window.close(); return true; } //]]> </script> </head> <body>'; }
public function sendPasswordResetLink() { $this->password_reset_code = Security::generateToken(); $this->save(); try { $mail = new \PHPMailer(true); $mail->From = getSiteEmail(); $mail->FromName = getSiteName(); $mail->addAddress($this->email); $mail->isHTML(true); $mail->Subject = display("email/forgot_password_subject"); $mail->Body = display("email/forgot_password_body", array("user_guid" => $this->guid)); $mail->From = getSiteEmail(); $mail->FromName = getSiteName(); $mail->isHTML(true); // Set email format to HTML $mail->send(); return true; } catch (\Exception $e) { return false; } }
/** * displayHeader * * @return void */ function displayHeader() { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => getSiteName(), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Contact'), 'pageId' => 'contact', 'path' => URL_PREFIX, 'displayname' => $this->fcmsUser->displayName, 'version' => getCurrentVersion()); displayPageHeader($params); }
<?php session_start(); define('URL_PREFIX', '../'); require URL_PREFIX . 'fcms.php'; setLanguage(); isLoggedIn('inc/'); $currentUserId = (int) $_SESSION['fcms_id']; echo ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . T_pgettext('Language Code for this translation', 'lang') . '" lang="' . T_pgettext('Language Code for this translation', 'lang') . '"> <head> <title>' . getSiteName() . ' - ' . T_('powered by') . ' ' . getCurrentVersion() . '</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="author" content="Ryan Haudenschilt" /> <link rel="stylesheet" type="text/css" href="../ui/themes/default/style.css"/> <link rel="shortcut icon" href="../ui/favicon.ico"/>'; // TODO // Move css to fcms-core echo ' <style type="text/css"> html { background: #fff; } body { width: 350px; margin: 0; padding: 15px; text-align: left; font: 14px/20px Verdana, Tahoma, Arial, sans-serif; border: none; background: #fff; } h1 { font: bold 20px/30px Verdana, Tahoma, Arial, sans-serif; } h2 { font: bold 18px/30px Verdana, Tahoma, Arial, sans-serif; } h3 { font: bold 16px/30px Verdana, Tahoma, Arial, sans-serif; } </style> </head> <body> <h1>' . T_('BBCode Help') . '</h1> <p>' . T_('BBCode is a easy way to format text. Check out the examples below, the first line shows the bbcode and the second line show the output.') . '</p>
*/ case 'setLanguage': setCurrentFile($sModule, $sLanguage, "langs"); break; /** * Get chat's config. */ /** * Get chat's config. */ case 'config': $sFileName = $sModulesPath . $sModule . "/xml/config.xml"; $rHandle = fopen($sFileName, "rt"); $sContents = fread($rHandle, filesize($sFileName)); fclose($rHandle); $sContents = str_replace("#siteName#", getSiteName(), $sContents); $iMaxFileSize = min(ini_get('upload_max_filesize') + 0, ini_get('post_max_size') + 0); $sContents = str_replace("#fileMaxSize#", $iMaxFileSize, $sContents); $sContents = str_replace("#soundsUrl#", $sSoundsUrl, $sContents); $sContents = str_replace("#smilesetsUrl#", $sSmilesetsUrl, $sContents); $sContents = str_replace("#filesUrl#", $sFilesUrl, $sContents); $sContents = str_replace("#useServer#", useServer() ? TRUE_VAL : FALSE_VAL, $sContents); $sContents = str_replace("#serverUrl#", getRMSUrl($sServerApp), $sContents); break; /** * Authorize user. */ /** * Authorize user. */ case 'userAuthorize':
* * SocialApparatus CONFIDENTIAL * __________________ * * [2002] - [2017] SocialApparatus (http://SocialApparatus.co) * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the property of SocialApparatus * and its suppliers, if any. The intellectual and technical concepts contained herein * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $access = getIgnoreAccess(); setIgnoreAccess(); $user_guid = Vars::get("user_guid"); $user = getEntity($user_guid); if ($user) { $password_reset_code = $user->password_reset_code; $link = getSiteURL() . "forgotPassword/" . $password_reset_code . "/" . $user->email; $body = translate("password_reset:email:body", array($user->first_name . " " . $user->last_name, getSiteName(), $link)); echo $body; } setIgnoreAccess($access);
/** * displaySubmit * * @param string $formParams The params that have been submitted to the form. * * @return void */ function displaySubmit($formParams = '') { $this->displayHeader(); if ($formParams == '') { $formData = $_POST; } else { $formData = $formParams; } // Make sure they filled out all required fields $required_fields = array('username', 'password', 'fname', 'lname', 'email'); foreach ($required_fields as $f) { if (strlen($formData[$f]) < 1) { $this->displayHtmlForm('<p class="error">' . T_('You forgot to fill out a required field.') . '</p>'); $this->displayFooter(); return; } } $email = strip_tags($formData['email']); $username = strip_tags($formData['username']); $fname = strip_tags($formData['fname']); $lname = strip_tags($formData['lname']); $password = $formData['password']; if ($formParams == '') { $hasher = new PasswordHash(8, FALSE); $password = $hasher->HashPassword($password); } // Is email available? $sql = "SELECT `email` \n FROM `fcms_users` \n WHERE `email` = ?"; $rows = $this->fcmsDatabase->getRows($sql, $email); if ($rows === false) { $this->fcmsError->displayError(); $this->displayFooter(); return; } if (count($rows) > 0) { $this->displayHtmlForm('<p class="error">' . T_('The email you have choosen is already in use. Please choose a different email.') . ' <a href="lostpw.php">' . T_('If you have forgotten your password please reset it') . '</a></p>'); $this->displayFooter(); return; } // Is username availabel? $sql = "SELECT `username` \n FROM `fcms_users` \n WHERE `username` = ?"; $rows = $this->fcmsDatabase->getRows($sql, $username); if ($rows === false) { $this->fcmsError->displayError(); $this->displayFooter(); return; } if (count($rows) > 0) { $this->displayHtmlForm('<p class="error">' . T_('Sorry, but that username is already taken. Please choose another username.') . '</p>'); $this->displayFooter(); return; } $sex = 'M'; if (isset($formData['sex'])) { $sex = $formData['sex'] == 'F' ? 'F' : 'M'; } // Create new user $sql = "INSERT INTO `fcms_users`\n (`access`, `joindate`, `fname`, `lname`, `sex`, `email`, `username`, `phpass`) \n VALUES \n (3, NOW(), ?, ?, ?, ?, ?, ?)"; $params = array($fname, $lname, $sex, $email, $username, $password); $lastid = $this->fcmsDatabase->insert($sql, $params); if ($lastid === false) { $this->fcmsError->displayError(); $this->displayFooter(); return; } $fbAccessToken = isset($formData['accessToken']) ? $formData['accessToken'] : ''; // Create user's settings $sql = "INSERT INTO `fcms_user_settings`\n (`user`, `fb_access_token`)\n VALUES \n (?, ?)"; if (!$this->fcmsDatabase->insert($sql, array($lastid, $fbAccessToken))) { $this->fcmsError->displayError(); $this->displayFooter(); return; } // Create user's address $sql = "INSERT INTO `fcms_address`\n (`user`, `updated`) \n VALUES \n (?, NOW())"; if (!$this->fcmsDatabase->insert($sql, array($lastid))) { $this->fcmsError->displayError(); $this->displayFooter(); return; } // Setup some stuff for sending email $sitename = getSiteName(); $now = gmdate('F j, Y, g:i a'); // TODO: use admin's tz? $subject = $sitename . ' ' . T_('Membership'); $message = ''; // Which activation method? $sql = "SELECT `value` AS 'auto_activate'\n FROM `fcms_config`\n WHERE `name` = 'auto_activate'"; $row = $this->fcmsDatabase->getRow($sql); if ($row === false) { $this->fcmsError->displayError(); $this->displayFooter(); return; } // Auto activation if ($row['auto_activate'] == 1) { $this->handleAutoActivation($email, $subject, $lastid, $sitename); } else { $message = T_('Dear') . ' ' . $fname . ' ' . $lname . ', ' . sprintf(T_('Thank you for registering at %s'), $sitename) . ' ' . T_('In order to login and begin using the site, your administrator must activate your account. You will get an email when this has been done.') . ' ' . T_('After your account is activated you can login using the following information') . ': ' . T_('Username') . ': ' . $username . ' ' . T_('Thanks') . ', ' . sprintf(T_('The %s Webmaster'), $sitename) . ' ' . T_('This is an automated response, please do not reply.'); echo ' <div id="msg"> <h1>' . T_('Congratulations and Welcome') . '</h1> <p> ' . sprintf(T_('You have been successfully registered at %s.'), $sitename) . ' ' . sprintf(T_('Your account information has been emailed to %s.'), $email) . '<br/> <b>' . T_('Please remember your username and password for this site.') . '</b> </p> <p>' . T_('Unfortunately your account must be activated before you can <a href="index.php">login</a> and begin using the site.') . '</p> </div>'; mail($email, $subject, $message, getEmailHeaders()); } // Email the admin $admin_subject = sprintf(T_('New User Registration at %s'), $sitename); $admin_message = sprintf(T_('A new user has registered at %s'), $sitename) . ': ' . T_('Time of Registration') . ': ' . $now . ' ' . T_('Username') . ': ' . $username . ' ' . T_('Name') . ': ' . $fname . ' ' . $lname; mail(getContactEmail(), $admin_subject, $admin_message, getEmailHeaders()); }
<?php include_once "header.php"; include_once "db.php"; $sitename = getSiteName(); $query = "show colums from user"; $result = mysql_query($query); $cookieExists = 0; while ($row = mysql_fetch_array($result)) { if (strcmp($row['Field'], "cookie") == 0) { $cookieExists = 1; } } if ($cookieExists == 0) { $query = "alter table user add cookie varchar(300)"; $status = mysql_query($query); echo "cookie column added<br />"; } else { echo "cookie column already exists!<br />"; } $query = "show columns from site"; $result = mysql_query($query); $indexNumexists = 0; $rssNumexists = 0; $twitterCheckexists = 0; $twitterEmailexists = 0; $twitterPassexists = 0; while ($row = mysql_fetch_array($result)) { if (strcmp($row['Field'], "indexNum") == 0) { $indexNumexists = 1; }
<?php /* * *********************************************************************** * * SocialApparatus CONFIDENTIAL * __________________ * * [2002] - [2017] SocialApparatus (http://SocialApparatus.co) * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the property of SocialApparatus * and its suppliers, if any. The intellectual and technical concepts contained herein * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $user_guid = Vars::get("user_guid"); $user = getEntity($user_guid); $name = $user->first_name . " " . $user->last_name; $SiteName = getSiteName(); $output = translate("verify_email:subject", array($name, $SiteName)); echo $output;
public function index($id = '') { $this->load->helper('url'); $this->load->helper('cms'); $this->lang->load('contact'); $this->m_contact_m = $this->load->model('m_contact/m_contact_m'); $this->data['forms'] = $this->m_contact_m->getFormField('contact'); $contact = $this->m_contact_m->getContact($id); if ($email = $this->input->post('email')) { $this->load->library('form_validation'); if (count($contact) > 0) { $this->form_validation->set_rules('subject', lang('subject'), 'trim|required|min_length[2]|max_length[200]'); $this->form_validation->set_rules('email', lang('email'), 'trim|required|valid_email'); if ($this->form_validation->run() == TRUE) { $name = $this->input->post('name'); $subject = $this->input->post('subject'); $message = $this->input->post('message'); // send email $config = array('mailtype' => 'html'); $this->load->library('email', $config); $this->email->from($email, getSiteName(config_item('site_name'))); $this->email->to($contact->email); if ($contact->copy == 1) { $this->email->cc($email); } if ($contact->subject != '' && strpos($contact->subject, '{content}') > 0) { // add subject $this->email->subject(str_replace('{content}', $subject, $contact->subject)); } else { $this->email->subject($subject); } if ($contact->message != '' && strpos($contact->message, '{content}') > 0) { // add message $message = str_replace('{content}', $message, $contact->message); } $fields = $this->input->post('fields'); $add_info = ''; if (is_array($fields)) { foreach ($fields as $key => $val) { $add_info .= $add_info . '<p>' . $key . ': ' . $val . '</p>'; } } $this->email->message($add_info . $message); if ($this->email->send()) { $this->data['msg'] = lang('contact_send_email_success_msg'); } else { $this->data['error'] = lang('contact_send_email_error_msg'); $this->data['data'] = $this->input->post(); } } else { $this->data['error'] = validation_errors(); $this->data['data'] = $this->input->post(); } } else { $this->data['error'] = lang('contact_not_found_msg'); } } if (count($contact) > 0) { $css = getCss($contact, 'module'); $this->data['contact'] = $contact; $this->data['css'] = $css; $this->load->view('m_contact', $this->data); } }
function getUSeo($uscr) { global $windid, $space, $uSeo; if ($uSeo = USeo::getInstance(false)) { return $uSeo->get(); } $appTitle = array('home' => '', 'article' => '帖子', 'diary' => '日志', 'weibo' => '新鲜事', 'kmd' => '孔明灯', 'galbum' => '相册', 'groups' => '群组', 'hot' => '热榜', 'photos' => '相册', 'sharelink' => '分享', 'share' => '分享', 'write' => '记录', 'message' => '消息', 'profile' => '帐号', 'jobcenter' => '任务', 'toolcenter' => '道具', 'friend' => '朋友', 'board' => '留言板', 'set' => '空间装扮', 'info' => '个人资料', 'appset' => '应用管理', 'default' => '个人中心'); $siteName = getSiteName('o'); list($t, $k) = explode('_', $uscr); if ($t == 'space') { if ($k == 'index') { return array($space['name'] . ' - ' . $siteName, $space['name'], $space['name'] . ',' . $siteName); } $kw = isset($appTitle[$k]) ? $appTitle[$k] : $appTitle['default']; return array($kw . ' - ' . $space['name'] . ' - ' . $siteName, $kw, $kw . ',' . $siteName); } else { $title = $appTitle[$k]; $windid && ($title .= ($title ? ' - ' : '') . $windid); $k == 'home' && ($title .= ' - ' . $siteName); return array($title, '', ''); } }
/** * displayHeader * * @return void */ function displayHeader($options = null) { $params = array('currentUserId' => $this->fcmsUser->id, 'sitename' => getSiteName(), 'nav-link' => getNavLinks(), 'pagetitle' => T_('Family News'), 'pageId' => 'familynews', 'path' => URL_PREFIX, 'displayname' => getUserDisplayName($this->fcmsUser->id), 'version' => getCurrentVersion(), 'year' => date('Y')); displayPageHeader($params, $options); if ($this->fcmsUser->access < 6 || $this->fcmsUser->access == 9) { echo ' <div id="sections_menu"> <ul> <li><a href="familynews.php">' . T_('Latest News') . '</a></li>'; if ($this->fcmsFamilyNews->hasNews($this->fcmsUser->id)) { echo ' <li><a href="?getnews=' . $this->fcmsUser->id . '">' . T_('My News') . '</a></li>'; } echo ' </ul> </div> <div id="actions_menu"> <ul> <li><a href="?addnews=yes">' . T_('Add News') . '</a></li> </ul> </div>'; } if (!isset($_GET['addnews']) && !isset($_POST['editnews'])) { $this->fcmsFamilyNews->displayNewsList(); } }
public function replaceParam($url) { $url = str_replace('[timestamp]', time(), $url); $trackingModel = new Tracking(); $hostReferer = $trackingModel->getRequestReferer(); $url = str_replace('[sitename]', getSiteName($hostReferer), $url); $hostReferer = !empty($_SERVER['HTTP_REFERER']) ? urlencode($_SERVER['HTTP_REFERER']) : ''; $url = str_replace('[yomedia_referer]', $hostReferer, $url); return $url; }