function FTForm(&$Context)
 {
     $this->Name = 'FTForm';
     $this->ValidActions = array('FeedThis', 'ProcessFeedThis');
     $this->Constructor($Context);
     if ($this->IsPostBack) {
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
         if ($this->PostBackAction == 'ProcessFeedThis') {
             $this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
             $this->ConfigurationManager->DefineSetting('FT_BLOG_FEED', ForceIncomingBool('FT_BLOG_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_BLOG_FEED_EVERY', ForceIncomingBool('FT_BLOG_FEED_EVERY', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_ALLDISCUSSIONS_FEED', ForceIncomingBool('FT_ALLDISCUSSIONS_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_ALLDISCUSSIONS_FEED_EVERY', ForceIncomingBool('FT_ALLDISCUSSIONS_FEED_EVERY', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_DISCUSSION_FEED', ForceIncomingBool('FT_DISCUSSION_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_CATEGORY_FEED', ForceIncomingBool('FT_CATEGORY_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_SEARCHRESULTS_FEED', ForceIncomingBool('FT_SEARCHRESULTS_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_USERBLOG_FEED', ForceIncomingBool('FT_USERBLOG_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_USERCOMMENTS_FEED', ForceIncomingBool('FT_USERCOMMENTS_FEED', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_PANEL_POSITION', ForceIncomingInt('FT_PANEL_POSITION', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_FEED_ITEMS', ForceIncomingInt('FT_FEED_ITEMS', 0), 0);
             $this->ConfigurationManager->DefineSetting('FT_WORD_LIMIT', ForceIncomingInt('FT_WORD_LIMIT', 0), 0);
             $this->DelegateParameters['ConfigurationManager'] =& $this->ConfigurationManager;
             // And save everything
             if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                 header('location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=FeedThis&Success=1'));
             } else {
                 $this->PostBackAction = 'FeedThis';
             }
         }
     }
 }
Esempio n. 2
0
 function NotifiForm(&$Context)
 {
     $this->Name = 'NotifiForm';
     $this->ValidActions = array('Notifi', 'ProcessNotifi');
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
         if ($this->PostBackAction == 'ProcessNotifi') {
             $this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
             $this->ConfigurationManager->DefineSetting('NOTIFI_ALLOW_ALL', ForceIncomingBool('NOTIFI_ALLOW_ALL', 0), 0);
             $this->ConfigurationManager->DefineSetting('NOTIFI_ALLOW_CATEGORY', ForceIncomingBool('NOTIFI_ALLOW_CATEGORY', 0), 0);
             $this->ConfigurationManager->DefineSetting('NOTIFI_ALLOW_DISCUSSION', ForceIncomingBool('NOTIFI_ALLOW_DISCUSSION', 0), 0);
             $this->ConfigurationManager->DefineSetting('NOTIFI_ALLOW_BBCODE', ForceIncomingBool('NOTIFI_ALLOW_BBCODE', 0), 0);
             $this->ConfigurationManager->DefineSetting('NOTIFI_FORMAT_PLAINTEXT', ForceIncomingBool('NOTIFI_FORMAT_PLAINTEXT', 0), 0);
             $this->ConfigurationManager->DefineSetting('NOTIFI_AUTO_ALL', ForceIncomingBool('NOTIFI_AUTO_ALL', 0), 0);
             if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                 header('Location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=Notifi&Success=1'));
             } else {
                 $this->PostBackAction = 'Notifi';
             }
         }
     }
     $this->CallDelegate('Constructor');
 }
 function GlobalsForm(&$Context)
 {
     $this->ValidActions = array("Globals", "ProcessGlobals");
     $this->Constructor($Context);
     if (!$this->Context->Session->User->MasterAdmin) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $ConstantsFile = agAPPLICATION_PATH . "appg/settings.php";
         $this->ConstantManager = $this->Context->ObjectFactory->NewContextObject($this->Context, "ConstantManager");
         if ($this->PostBackAction == "ProcessGlobals") {
             $this->ConstantManager->GetConstantsFromForm($ConstantsFile);
             // Checkboxes aren't posted back if unchecked, so make sure that they are saved properly
             $this->ConstantManager->SetConstant("agALLOW_NAME_CHANGE", ForceIncomingBool("agALLOW_NAME_CHANGE", 0), 0);
             $this->ConstantManager->SetConstant("agPUBLIC_BROWSING", ForceIncomingBool("agPUBLIC_BROWSING", 0), 0);
             $this->ConstantManager->SetConstant("agUSE_CATEGORIES", ForceIncomingBool("agUSE_CATEGORIES", 0), 0);
             $this->ConstantManager->SetConstant("agLOG_ALL_IPS", ForceIncomingBool("agLOG_ALL_IPS", 0), 0);
             // And save everything
             if ($this->ConstantManager->SaveConstantsToFile($ConstantsFile)) {
                 $this->PostBackValidated = 1;
             } else {
                 $this->PostBackAction = "Globals";
             }
         } else {
             $this->ConstantManager->DefineConstantsFromFile($ConstantsFile);
         }
     }
 }
 function GlobalsForm(&$Context)
 {
     $this->Name = 'GlobalsForm';
     $this->ValidActions = array('Globals', 'ProcessGlobals');
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission('PERMISSION_CHANGE_APPLICATION_SETTINGS')) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $this->Context->PageTitle = $this->Context->GetDefinition('ApplicationSettings');
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
         if ($this->PostBackAction == 'ProcessGlobals' && $this->IsValidFormPostBack()) {
             $this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
             // Checkboxes aren't posted back if unchecked, so make sure that they are saved properly
             $this->ConfigurationManager->DefineSetting('ENABLE_WHISPERS', ForceIncomingBool('ENABLE_WHISPERS', 0), 0);
             $this->ConfigurationManager->DefineSetting('ALLOW_NAME_CHANGE', ForceIncomingBool('ALLOW_NAME_CHANGE', 0), 0);
             $this->ConfigurationManager->DefineSetting('PUBLIC_BROWSING', ForceIncomingBool('PUBLIC_BROWSING', 0), 0);
             $this->ConfigurationManager->DefineSetting('USE_CATEGORIES', ForceIncomingBool('USE_CATEGORIES', 0), 0);
             $this->ConfigurationManager->DefineSetting('LOG_ALL_IPS', ForceIncomingBool('LOG_ALL_IPS', 0), 0);
             //Validate cookie domain.
             //The pattern is loose; eg, It won't stop  "domain.tld" or ".co.uk" to be saved
             //(the "domain.tld" can be set by the browser, the 2nd won't).
             Validate($this->Context->GetDefinition('CookieDomain'), 0, ForceIncomingString('COOKIE_DOMAIN', ''), 255, '^[\\.-_~a-zA-Z0-9]*\\.?[-_~a-zA-Z0-9]+\\.[-_~a-zA-Z0-9]+$', $this->Context);
             // And save everything
             if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                 header('Location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=Globals&Success=1'));
             } else {
                 $this->PostBackAction = 'Globals';
             }
         }
     }
     $this->CallDelegate('Constructor');
 }
 function GlobalsForm(&$Context)
 {
     $this->Name = 'GlobalsForm';
     $this->ValidActions = array('Globals', 'ProcessGlobals');
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission('PERMISSION_CHANGE_APPLICATION_SETTINGS')) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $this->Context->PageTitle = $this->Context->GetDefinition('ApplicationSettings');
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
         if ($this->PostBackAction == 'ProcessGlobals' && $this->IsValidFormPostBack()) {
             $this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
             // Checkboxes aren't posted back if unchecked, so make sure that they are saved properly
             $this->ConfigurationManager->DefineSetting('ENABLE_WHISPERS', ForceIncomingBool('ENABLE_WHISPERS', 0), 0);
             $this->ConfigurationManager->DefineSetting('ALLOW_NAME_CHANGE', ForceIncomingBool('ALLOW_NAME_CHANGE', 0), 0);
             $this->ConfigurationManager->DefineSetting('PUBLIC_BROWSING', ForceIncomingBool('PUBLIC_BROWSING', 0), 0);
             $this->ConfigurationManager->DefineSetting('USE_CATEGORIES', ForceIncomingBool('USE_CATEGORIES', 0), 0);
             $this->ConfigurationManager->DefineSetting('LOG_ALL_IPS', ForceIncomingBool('LOG_ALL_IPS', 0), 0);
             // And save everything
             if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                 header('location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=Globals&Success=1'));
             } else {
                 $this->PostBackAction = 'Globals';
             }
         }
     }
     $this->CallDelegate('Constructor');
 }
 function SignInForm(&$Context, $FormName)
 {
     $this->Name = 'SignInForm';
     $this->ValidActions = array('SignIn');
     $this->Constructor($Context);
     if ($this->PostBackAction == '') {
         $this->IsPostBack = 1;
     }
     if ($this->IsPostBack) {
         $this->FormName = $FormName;
         $this->ReturnUrl = urldecode(ForceIncomingString('ReturnUrl', ''));
         $ValidateReturnUrl = strstr($this->ReturnUrl, $this->Context->Configuration['COOKIE_DOMAIN'] . $this->Context->Configuration['COOKIE_PATH']);
         if ($this->ReturnUrl != '') {
             $this->PostBackParams->Add('ReturnUrl', $this->ReturnUrl);
         }
         $this->Username = ForceIncomingString('Username', '');
         $this->Password = ForceIncomingString('Password', '', false);
         $this->RememberMe = ForceIncomingBool('RememberMe', 0);
         // Set up the page
         global $Banner, $Foot;
         $Banner->Properties['CssClass'] = 'SignIn';
         $Foot->CssClass = 'SignIn';
         $this->Context->PageTitle = $this->Context->GetDefinition('SignIn');
         if ($this->PostBackAction == 'SignIn') {
             $UserManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
             // Check for an already active session
             if ($this->Context->Session->UserID != 0) {
                 $this->PostBackValidated = 1;
             } else {
                 // Attempt to create a new session for the user
                 if ($UserManager->ValidateUserCredentials($this->Username, $this->Password, $this->RememberMe)) {
                     $this->PostBackValidated = 1;
                     //Automatically redirect if this user isn't a user administrator or there aren't any new applicants
                     $AutoRedirect = 1;
                     if ($this->Context->Session->User->Permission('PERMISSION_APPROVE_APPLICANTS')) {
                         $this->ApplicantCount = $UserManager->GetApplicantCount();
                         if ($this->ApplicantCount > 0) {
                             $AutoRedirect = 0;
                         }
                     }
                     if ($this->ReturnUrl == '' || empty($ValidateReturnUrl)) {
                         $this->ReturnUrl = $this->Context->Configuration['FORWARD_VALIDATED_USER_URL'];
                     } else {
                         $this->ReturnUrl = str_replace('&', '&', $this->ReturnUrl);
                     }
                     if ($AutoRedirect && $this->ReturnUrl != '') {
                         //@todo: Should the the process die here?
                         Redirect($this->ReturnUrl, '302', '', 0);
                     }
                 }
             }
         }
         $this->Context->BodyAttributes = " onload=\"Focus('txtUsername');\"";
     }
     $this->CallDelegate('Constructor');
 }
Esempio n. 7
0
 function Render_NoPostBack()
 {
     $this->Username = FormatStringForDisplay($this->Username, 1);
     $this->PostBackParams->Add("PostBackAction", "SignIn");
     $this->PostBackParams->Add("ReturnUrl", $this->ReturnUrl);
     $this->Render_Warnings();
     $this->Context->Writer->Add("<div class=\"About\">\r\n\t\t\t" . $this->Context->GetDefinition("AboutVanilla") . "\r\n\t\t</div>\r\n\t\t<div class=\"Form\">\r\n\t\t\t" . $this->Context->GetDefinition("MemberSignIn"));
     $this->Render_PostBackForm($this->FormName);
     $this->Context->Writer->Write("<dl class=\"InputBlock SignInInputs\">\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("Username") . "</dt>\r\n\t\t\t\t<dd><input type=\"text\" name=\"Username\" value=\"" . $this->Username . "\" class=\"Input\" maxlength=\"20\" /></dd>\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("Password") . "</dt>\r\n\t\t\t\t<dd><input type=\"password\" name=\"Password\" value=\"\" class=\"Input\" /></dd>\r\n\t\t\t</dl>\r\n\t\t\t<div class=\"InputBlock RememberMe\">" . GetDynamicCheckBox("RememberMe", 1, ForceIncomingBool("RememberMe", 0), "", $this->Context->GetDefinition("RememberMe")) . "</div>\r\n\t\t\t<a class=\"ForgotPasswordLink\" href=\"passwordrequest.php\">" . $this->Context->GetDefinition("ForgotYourPassword") . "</a>\r\n\t\t\t<div class=\"FormButtons\"><input type=\"submit\" name=\"btnSignIn\" value=\"" . $this->Context->GetDefinition("Proceed") . "\" class=\"Button\" /></div>\r\n\t\t\t</form>\r\n\t\t</div>");
 }
 function GetPropertiesFromForm()
 {
     $this->RoleID = ForceIncomingInt("RoleID", 0);
     $this->Name = ForceIncomingString("Name", "");
     $this->Icon = ForceIncomingString("Icon", "");
     $this->Description = ForceIncomingString("Description", "");
     $this->CanLogin = ForceIncomingBool("CanLogin", 0);
     $this->CanPostDiscussion = ForceIncomingBool("CanPostDiscussion", 0);
     $this->CanPostComment = ForceIncomingBool("CanPostComment", 0);
     $this->CanPostHTML = ForceIncomingBool("CanPostHTML", 0);
     $this->CanViewIps = ForceIncomingBool("CanViewIps", 0);
     $this->AdminUsers = ForceIncomingBool("AdminUsers", 0);
     $this->AdminCategories = ForceIncomingBool("AdminCategories", 0);
     $this->MasterAdmin = ForceIncomingBool("MasterAdmin", 0);
     $this->ShowAllWhispers = ForceIncomingBool("ShowAllWhispers", 0);
 }
 function LanguageForm(&$Context)
 {
     $this->Name = "LanguageForm";
     $this->ValidActions = array("LanguageChange", "ProcessLanguageChange");
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission("PERMISSION_MANAGE_LANGUAGE")) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $this->Context->PageTitle = $this->Context->GetDefinition('LanguageManagement');
         $this->DefineLanguages();
         $this->LanguageSelect = $this->Context->ObjectFactory->NewObject($Context, "Select");
         $this->LanguageSelect->Name = "LanguageKey";
         $this->LanguageSelect->Attributes = ' id="ddLanguage"';
         for ($i = 0; $i < count($this->Languages); $i++) {
             $this->LanguageSelect->AddOption($i, $this->Languages[$i]);
             if ($this->Languages[$i] == $this->Context->Configuration['LANGUAGE']) {
                 $this->LanguageSelect->SelectedValue = $i;
             }
         }
         if ($this->PostBackAction == "ProcessLanguageChange" && $this->IsValidFormPostBack()) {
             $LanguageKey = ForceIncomingInt("LanguageKey", 0);
             // Grab that language from the languages array
             $Language = $this->Languages[$LanguageKey];
             if ($Language) {
                 // Set the language configuration option
                 $ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, "ConfigurationManager");
                 $ConfigurationManager->DefineSetting('LANGUAGE', $Language, 1);
                 $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
                 if ($ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                     // If everything was successful, mark the postback as validated
                     if ($this->Context->WarningCollector->Iif()) {
                         $Url = GetUrl($this->Context->Configuration, $this->Context->SelfUrl, "", "", "", "", "PostBackAction=LanguageChange&Saved=1");
                         Redirect($Url);
                     }
                 }
             }
         } elseif ($this->PostBackAction == "LanguageChange" && ForceIncomingBool("Saved", 0) == 1) {
             $this->PostBackValidated = 1;
         }
     }
     $this->CallDelegate("Constructor");
 }
Esempio n. 10
0
 function GetPropertiesFromForm()
 {
     $this->SearchID = ForceIncomingInt('SearchID', 0);
     $this->Label = ForceIncomingString('Label', '');
     $this->Type = $this->DefineType(ForceIncomingString('Type', ''));
     $this->Keywords = urldecode(ForceIncomingString('Keywords', ''));
     // Parse out the keywords differently based on the type of search
     $Advanced = ForceIncomingBool('Advanced', 0);
     if ($Advanced) {
         // Load all of the search variables from the form
         $this->Categories = ForceIncomingString('Categories', '');
         $this->AuthUsername = ForceIncomingString('AuthUsername', '');
         $this->Roles = ForceIncomingString('Roles', '');
         $this->UserOrder = ForceIncomingString('UserOrder', '');
         $this->Query = $this->Keywords;
         // Build the keyword definition
         $KeyDef = '';
         if ($this->Type == 'Users') {
             if ($this->Roles != '') {
                 $KeyDef = 'roles:' . $this->Roles . ';';
             }
             if ($this->UserOrder != '') {
                 $KeyDef .= 'sort:' . $this->UserOrder . ';';
             }
             $this->Keywords = $KeyDef . $this->Keywords;
         } else {
             if ($this->Categories != '') {
                 $KeyDef = 'cats:' . $this->Categories . ';';
             }
             if ($this->AuthUsername != '') {
                 $KeyDef .= $this->AuthUsername . ':';
             }
             $this->Keywords = $KeyDef . $this->Keywords;
         }
     } else {
         // Load all of the search variables from the keyword definition
         $this->ParseKeywords($this->Type, $this->Keywords);
     }
 }
 function GetPropertiesFromForm()
 {
     $this->SearchID = ForceIncomingInt("SearchID", 0);
     $this->Label = ForceIncomingString("Label", "");
     $this->Type = $this->DefineType(ForceIncomingString("Type", ""));
     $this->Keywords = urldecode(ForceIncomingString("Keywords", ""));
     // Parse out the keywords differently based on the type of search
     $Advanced = ForceIncomingBool("Advanced", 0);
     if ($Advanced) {
         // Load all of the search variables from the form
         $this->Categories = ForceIncomingString("Categories", "");
         $this->AuthUsername = ForceIncomingString("AuthUsername", "");
         $this->Roles = ForceIncomingString("Roles", "");
         $this->UserOrder = ForceIncomingString("UserOrder", "");
         $this->Query = $this->Keywords;
         // Build the keyword definition
         $KeyDef = "";
         if ($this->Type == "Users") {
             if ($this->Roles != "") {
                 $KeyDef = "roles:" . $this->Roles . ";";
             }
             if ($this->UserOrder != "") {
                 $KeyDef .= "sort:" . $this->UserOrder . ";";
             }
             $this->Keywords = $KeyDef . $this->Keywords;
         } else {
             if ($this->Categories != "") {
                 $KeyDef = "cats:" . $this->Categories . ";";
             }
             if ($this->AuthUsername != "") {
                 $KeyDef .= $this->AuthUsername . ":";
             }
             $this->Keywords = $KeyDef . $this->Keywords;
         }
     } else {
         // Load all of the search variables from the keyword definition
         $this->ParseKeywords($this->Type, $this->Keywords);
     }
 }
Esempio n. 12
0
        }
        if ($ShowUpdateMessage) {
            $Message = '';
            if ($Days == 0) {
                $Message = $Context->GetDefinition('NeverCheckedForUpdates');
            } else {
                $Message = str_replace('//1', $Days, $Context->GetDefinition('XDaysSinceUpdateCheck'));
            }
            $NoticeCollector->AddNotice($Message . ' <a href="' . GetUrl($Configuration, 'settings.php', '', '', '', '', 'PostBackAction=UpdateCheck') . '">' . $Context->GetDefinition('CheckForUpdatesNow') . '</a>');
        }
    }
}
// Remind them to get addons if this is a new install
if ($Configuration['ADDON_NOTICE']) {
    if ($Context->Session->User && $Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) {
        $HideNotice = ForceIncomingBool('TurnOffAddonNotice', 0);
        if ($HideNotice) {
            $SettingsFile = $Configuration['APPLICATION_PATH'] . 'conf/settings.php';
            $SettingsManager = $Context->ObjectFactory->NewContextObject($Context, 'ConfigurationManager');
            $SettingsManager->DefineSetting("ADDON_NOTICE", '0', 1);
            $SettingsManager->SaveSettingsToFile($SettingsFile);
        } else {
            $NoticeCollector->AddNotice('<span><a href="' . GetUrl($Configuration, 'index.php', '', '', '', '', 'TurnOffAddonNotice=1') . '">' . $Context->GetDefinition('RemoveThisNotice') . '</a></span>
					' . $Context->GetDefinition('WelcomeToVanillaGetSomeAddons'));
        }
    }
}
// 3. ADD CONTROLS TO THE PAGE
$Page->AddRenderControl($Head, $Configuration['CONTROL_POSITION_HEAD']);
$Page->AddRenderControl($Menu, $Configuration['CONTROL_POSITION_MENU']);
$Page->AddRenderControl($Panel, $Configuration['CONTROL_POSITION_PANEL']);
 function GetPropertiesFromForm($Configuration)
 {
     $this->RoleID = ForceIncomingInt('RoleID', 0);
     $this->RoleName = ForceIncomingString('RoleName', '');
     $this->Icon = ForceIncomingString('Icon', '');
     $this->Description = ForceIncomingString('Description', '');
     $this->Unauthenticated = ForceIncomingBool('Unauthenticated', 0);
     $this->PERMISSION_SIGN_IN = ForceIncomingBool('PERMISSION_SIGN_IN', 0);
     $this->PERMISSION_HTML_ALLOWED = ForceIncomingBool('PERMISSION_HTML_ALLOWED', 0);
     $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION = ForceIncomingBool('PERMISSION_RECEIVE_APPLICATION_NOTIFICATION', 0);
     while (list($Key, $Permission) = each($this->Permissions)) {
         $this->Permissions[$Key] = ForceIncomingBool($Key, 0);
     }
 }
<?php

// Note: This file is included from the library/Vanilla/Vanilla.Control.GlobalsForm.php control.
echo '<div id="Form" class="Account GlobalsForm">';
if (ForceIncomingBool('Success', 0)) {
    echo '<div id="Success">' . $this->Context->GetDefinition('GlobalApplicationChangesSaved') . '</div>';
}
echo '<fieldset>
		<legend>' . $this->Context->GetDefinition('GlobalApplicationSettings') . '</legend>
		' . $this->Get_Warnings() . '
		' . $this->Get_PostBackForm('frmApplicationGlobals') . '
		<h2>' . $this->Context->GetDefinition('Warning') . '</h2>
		<p>
			' . $this->Context->GetDefinition('GlobalApplicationSettingsNotes') . '
		</p>

		<h2>' . $this->Context->GetDefinition('ApplicationTitles') . '</h2>
		<ul>
			<li>
				<label for="txtApplicationTitle">' . $this->Context->GetDefinition('ApplicationTitle') . '</label>
				<input type="text" name="APPLICATION_TITLE" value="' . $this->ConfigurationManager->GetSetting('APPLICATION_TITLE') . '" maxlength="50" class="SmallInput" id="txtApplicationTitle" />
			</li>
			<li>
				<label for="txtBannerTitle">' . $this->Context->GetDefinition('BannerTitle') . '</label>
				<input type="text" name="BANNER_TITLE" value="' . $this->ConfigurationManager->GetSetting('BANNER_TITLE') . '" class="SmallInput" id="txtBannerTitle" />
				<p class="Description">' . $this->Context->GetDefinition('ApplicationTitlesNotes') . '</p>
			</li>
		</ul>

		<h2>' . $this->Context->GetDefinition('ForumOptions') . '</h2>
		<ul>
 function GetPropertiesFromForm()
 {
     $this->UserID = ForceIncomingInt('u', 0);
     $this->RoleID = ForceIncomingInt('RoleID', 0);
     $this->StyleID = ForceIncomingInt('StyleID', 0);
     $this->CustomStyle = ForceIncomingString('CustomStyle', '');
     $this->Name = ForceIncomingString('Name', '');
     $this->FirstName = ForceIncomingString('FirstName', '');
     $this->LastName = ForceIncomingString('LastName', '');
     $this->ShowName = ForceIncomingBool('ShowName', 0);
     $this->Email = ForceIncomingString('Email', '');
     $this->UtilizeEmail = ForceIncomingBool('UtilizeEmail', 0);
     $this->Password = ForceIncomingString('Password', '');
     $this->Icon = PrependString(array('http://', 'https://'), ForceIncomingString('Icon', ''));
     $this->Picture = PrependString(array('http://', 'https://'), ForceIncomingString('Picture', ''));
     $this->AgreeToTerms = ForceIncomingBool('AgreeToTerms', 0);
     $this->ReadTerms = ForceIncomingBool('ReadTerms', 0);
     $this->Discovery = ForceIncomingString('Discovery', '');
     $this->OldPassword = ForceIncomingString('OldPassword', '');
     $this->NewPassword = ForceIncomingString('NewPassword', '');
     $this->ConfirmPassword = ForceIncomingString('ConfirmPassword', '');
     // Retrieve attributes from the form
     $AttributeCount = ForceIncomingInt('LabelValuePairCount', 0);
     $Label = '';
     $Value = '';
     for ($i = 0; $i < $AttributeCount; $i++) {
         $Label = ForceIncomingString('Label' . ($i + 1), '');
         $Label = strip_tags($Label);
         $Label = str_replace("\\\"", "", $Label);
         $Value = ForceIncomingString("Value" . ($i + 1), "");
         $Value = strip_tags($Value);
         $Value = str_replace("\\\"", "", $Value);
         if ($Label != '' && $Value != '') {
             $this->Attributes[] = array('Label' => $Label, 'Value' => $Value);
         }
     }
 }
Esempio n. 16
0
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: File used by Dynamic Data Management object to handle any type of boolean switch
*/
include '../appg/settings.php';
include '../appg/init_ajax.php';
$PostBackKey = ForceIncomingString('PostBackKey', '');
$ExtensionKey = ForceIncomingString('ExtensionKey', '');
if ($PostBackKey != '' && $PostBackKey == $Context->Session->GetVariable('SessionPostBackKey', 'string')) {
    $Type = ForceIncomingString('Type', '');
    $Switch = ForceIncomingBool('Switch', 0);
    $DiscussionID = ForceIncomingInt('DiscussionID', 0);
    $CommentID = ForceIncomingInt('CommentID', 0);
    // Don't create unnecessary objects
    if (in_array($Type, array('Active', 'Closed', 'Sticky', 'Sink'))) {
        $dm = $Context->ObjectFactory->NewContextObject($Context, 'DiscussionManager');
    } elseif ($Type == 'Comment') {
        $cm = $Context->ObjectFactory->NewContextObject($Context, 'CommentManager');
    } else {
        // This will allow the switch class to be used to add new custom user settings
        $um = $Context->ObjectFactory->NewContextObject($Context, 'UserManager');
    }
    // Handle the switches
    if ($Type == 'Bookmark' && $DiscussionID > 0) {
        if ($Context->Session->UserID == 0) {
            die;
 function GetPropertiesFromForm()
 {
     $this->UserID = ForceIncomingInt("u", 0);
     $this->RoleID = ForceIncomingInt("RoleID", 0);
     $this->StyleID = ForceIncomingInt("StyleID", 0);
     $this->CustomStyle = ForceIncomingString("CustomStyle", "");
     $this->Name = ForceIncomingString("Name", "");
     $this->FirstName = ForceIncomingString("FirstName", "");
     $this->LastName = ForceIncomingString("LastName", "");
     $this->ShowName = ForceIncomingBool("ShowName", 0);
     $this->Email = ForceIncomingString("Email", "");
     $this->UtilizeEmail = ForceIncomingBool("UtilizeEmail", 0);
     $this->Password = ForceIncomingString("Password", "");
     $this->Icon = PrependString("http://", ForceIncomingString("Icon", ""));
     $this->Picture = PrependString("http://", ForceIncomingString("Picture", ""));
     $this->AgreeToTerms = ForceIncomingBool("AgreeToTerms", 0);
     $this->ReadTerms = ForceIncomingBool("ReadTerms", 0);
     $this->Discovery = ForceIncomingString("Discovery", "");
     $this->OldPassword = ForceIncomingString("OldPassword", "");
     $this->NewPassword = ForceIncomingString("NewPassword", "");
     $this->ConfirmPassword = ForceIncomingString("ConfirmPassword", "");
     // Retrieve attributes from the form
     $AttributeCount = ForceIncomingInt("LabelValuePairCount", 0);
     $Label = "";
     $Value = "";
     for ($i = 0; $i < $AttributeCount; $i++) {
         $Label = ForceIncomingString("Label" . ($i + 1), "");
         $Label = strip_tags($Label);
         $Label = str_replace("\\\"", "", $Label);
         $Value = ForceIncomingString("Value" . ($i + 1), "");
         $Value = strip_tags($Value);
         $Value = str_replace("\\\"", "", $Value);
         if ($Label != "" && $Value != "") {
             $this->Attributes[] = array("Label" => $Label, "Value" => $Value);
         }
     }
 }
Esempio n. 18
0
/*
* Copyright 2003 - 2005 Mark O'Sullivan
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: File used by Dynamic Data Management object to block/unblock user comments
*/
include "../appg/settings.php";
include "../appg/init_ajax.php";
$Context->Session->Check(agSAFE_REDIRECT);
$Block = ForceIncomingBool("Block", 0);
$BlockUserID = ForceIncomingInt("BlockUserID", 0);
$BlockCommentID = ForceIncomingInt("BlockCommentID", 0);
$BlockCategoryID = ForceIncomingInt("BlockCategoryID", 0);
$um = $Context->ObjectFactory->NewContextObject($Context, "UserManager");
if ($BlockUserID > 0) {
    if ($Block) {
        $um->AddUserBlock($BlockUserID);
    } else {
        $um->RemoveUserBlock($BlockUserID);
    }
} elseif ($BlockCommentID > 0) {
    if ($Block) {
        $um->AddCommentBlock($BlockCommentID);
    } else {
        $um->RemoveCommentBlock($BlockCommentID);
 function ThemeAndStyleForm(&$Context)
 {
     $this->Name = 'ThemeAndStyleForm';
     $this->ValidActions = array('ThemeChange', 'ProcessThemeChange', 'ProcessStyleChange');
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission("PERMISSION_MANAGE_THEMES") && !$this->Context->Session->User->Permission("PERMISSION_MANAGE_STYLES")) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $this->Context->PageTitle = $this->Context->GetDefinition('ManageThemeAndStyle');
         $this->DefineThemes();
         // Get the name of the current theme folder
         $CurrentThemeKey = ForceIncomingString('Theme', '');
         if ($CurrentThemeKey != '') {
             $CurrentTheme = $this->Themes[ForceInt($CurrentThemeKey, 0)];
         } else {
             $CurrentThemePath = str_replace('\\', '/', $this->Context->Configuration['THEME_PATH']);
             if (substr($CurrentThemePath, strlen($CurrentThemePath) - 1, 1) == '/') {
                 $CurrentThemePath = substr($CurrentThemePath, 0, strlen($CurrentThemePath) - 1);
             }
             $CurrentThemeParts = explode('/', $CurrentThemePath);
             $CurrentTheme = $CurrentThemeParts[count($CurrentThemeParts) - 1];
         }
         $this->DefineStyles($this->Context->Configuration['APPLICATION_PATH'] . 'themes/' . $CurrentTheme . '/');
         // Create the theme dropdown
         if ($this->Context->Session->User->Permission("PERMISSION_MANAGE_THEMES")) {
             $this->ThemeSelect = $this->Context->ObjectFactory->NewObject($Context, "Select");
             $this->ThemeSelect->Name = "Theme";
             $this->ThemeSelect->Attributes = " id=\"ddTheme\" onchange=\"document.location='" . GetUrl($this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=ThemeChange&amp;Theme=') . "'+this.options[this.selectedIndex].value;\"";
             for ($i = 0; $i < count($this->Themes); $i++) {
                 $this->ThemeSelect->AddOption($i, $this->Themes[$i]);
                 if ($this->Themes[$i] == $CurrentTheme) {
                     $this->ThemeSelect->SelectedValue = $i;
                 }
             }
         }
         // Create the style dropdown
         if ($this->Context->Session->User->Permission("PERMISSION_MANAGE_STYLES")) {
             $this->StyleSelect = $this->Context->ObjectFactory->NewObject($Context, "Select");
             $this->StyleSelect->Name = "Style";
             $this->StyleSelect->Attributes = ' id="ddStyle"';
             for ($i = 0; $i < count($this->Styles); $i++) {
                 $this->StyleSelect->AddOption($i, $this->Styles[$i]);
                 if ($this->Context->Configuration['WEB_ROOT'] . 'themes/' . $CurrentTheme . '/styles/' . $this->Styles[$i] . '/' == $this->Context->Configuration['DEFAULT_STYLE']) {
                     $this->StyleSelect->SelectedValue = $i;
                 }
             }
         }
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         if ($this->PostBackAction == "ProcessThemeChange" && $this->IsValidFormPostBack()) {
             $Theme = $this->Themes[ForceIncomingInt('Theme', 0)];
             // Set the theme configuration option
             if ($this->Context->Session->User->Permission("PERMISSION_MANAGE_THEMES")) {
                 $ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, "ConfigurationManager");
                 $ConfigurationManager->DefineSetting('THEME_PATH', $this->Context->Configuration['APPLICATION_PATH'] . 'themes/' . $Theme . '/', 1);
                 $ConfigurationManager->SaveSettingsToFile($SettingsFile);
             }
             if ($this->Context->Session->User->Permission("PERMISSION_MANAGE_STYLES")) {
                 // Set the style configuration option
                 $StyleKey = ForceIncomingString("Style", '');
                 $NewStyleName = $this->Styles[$StyleKey];
                 $NewStylePath = $this->Context->Configuration['WEB_ROOT'] . 'themes/' . $CurrentTheme . '/styles/' . $NewStyleName . '/';
                 $ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, "ConfigurationManager");
                 $ConfigurationManager->DefineSetting('DEFAULT_STYLE', $NewStylePath, 1);
                 $ConfigurationManager->SaveSettingsToFile($SettingsFile);
                 // See if this style exists in the database yet
                 $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
                 $s->SetMainTable('Style', 's');
                 $s->AddSelect('StyleID', 's');
                 $s->AddWhere('s', 'Url', '', $NewStylePath, '=');
                 $StyleData = $this->Context->Database->Select($s, $this->Name, 'Constructor', 'An error occurred while attempting to retrieve information from the database about the selected style.');
                 $StyleID = 0;
                 while ($rows = $this->Context->Database->GetRow($StyleData)) {
                     $StyleID = ForceInt($rows['StyleID'], 0);
                 }
                 // If the style doesn't exist yet, add it
                 if ($StyleID == 0) {
                     $s->Clear();
                     $s->SetMainTable('Style', 's');
                     $s->AddFieldNameValue('Name', $NewStyleName);
                     $s->AddFieldNameValue('Url', $NewStylePath);
                     $s->AddFieldNameValue('PreviewImage', 'preview.gif');
                     $StyleID = $this->Context->Database->Insert($s, $this->Name, 'Constructor', 'An error occurred while adding the style to the database.');
                 }
                 // Now that the style has been properly defined, apply it to all users if required
                 if ($StyleID > 0 && ForceIncomingBool('ApplyStyleToUsers', 0)) {
                     $s->Clear();
                     $s->SetMainTable('User', 'u');
                     $s->AddFieldNameValue('StyleID', $StyleID);
                     $this->Context->Database->Update($s, $this->Name, 'Constructor', 'An error occurred while applying the style to the user accounts.');
                 }
             }
             if ($this->Context->WarningCollector->Count() == 0) {
                 // If everything was successful, mark the postback as validated
                 if ($this->Context->WarningCollector->Iif()) {
                     header("Location:" . GetUrl($this->Context->Configuration, $this->Context->SelfUrl, "", "", "", "", "PostBackAction=ThemeChange&Saved=1"));
                     die;
                 }
             }
         }
     }
     $this->CallDelegate("Constructor");
 }
<?php

// Note: This file is included from the library/Framework/Framework.Control.UpdateCheck.php control.
echo '<div id="Form" class="Account UpdateCheck">
   <fieldset>
      <legend>' . $this->Context->GetDefinition('UpdateCheck') . '</legend>
      ' . $this->Get_Warnings() . '
      ' . $this->Get_PostBackForm('frmUpdateCheck') . '
      <p>' . $this->Context->GetDefinition('UpdateCheckNotes') . '</p>
      <p><input type="submit" name="btnCheck" value="' . $this->Context->GetDefinition('CheckForUpdates') . '" class="Button SubmitButton Update" /></p>
      </form>
   </fieldset>';
$this->PostBackParams->Set('PostBackAction', 'ProcessUpdateReminder');
if (ForceIncomingBool('Saved', 0)) {
    echo '<div id="Success">' . $this->Context->GetDefinition('ReminderChangesSaved') . '</div>';
}
echo '
   <fieldset>
      <legend>' . $this->Context->GetDefinition('UpdateReminders') . '</legend>
      ' . $this->Get_PostBackForm('frmUpdateReminders') . '
      <p>' . $this->Context->GetDefinition('UpdateReminderNotes') . '</p>
      <ul>
         <li>
            <label for="dReminder">' . $this->Context->GetDefinition('ReminderLabel') . '</label>
            ' . $this->ReminderSelect->Get() . '
         </li>
      </ul>
      <p>
         <input type="submit" name="btnCheck" value="' . $this->Context->GetDefinition('Save') . '" class="Button SubmitButton UpdateReminder" />
      </p>
      </form>
Esempio n. 21
0
/*
* Copyright 2003 - 2005 Mark O'Sullivan
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: File used by Dynamic Data Management object to handle any type of boolean switch
*/
include "../appg/settings.php";
include "../appg/init_ajax.php";
$Type = ForceIncomingString("Type", "");
$Switch = ForceIncomingBool("Switch", 0);
$DiscussionID = ForceIncomingInt("DiscussionID", 0);
$CommentID = ForceIncomingInt("CommentID", 0);
$SearchID = ForceIncomingInt("SearchID", 0);
// Don't create unnecessary objects
if (in_array($Type, array("Active", "Closed", "Sticky"))) {
    include sgLIBRARY . "Vanilla.Discussion.class.php";
    $dm = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager");
} elseif ($Type == "Comment") {
    include sgLIBRARY . "Vanilla.Comment.class.php";
    $cm = $Context->ObjectFactory->NewContextObject($Context, "CommentManager");
} elseif ($Type == "RemoveSearch") {
    include sgLIBRARY . "Vanilla.Search.class.php";
    $sm = $Context->ObjectFactory->NewContextObject($Context, "SearchManager");
} else {
    // This will allow the switch class to be used to add new custom user settings
Esempio n. 22
0
* Copyright 2003 Mark O'Sullivan
* This file is part of Vanilla.
* Vanilla is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
* Vanilla is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with Vanilla; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
* The latest source code for Vanilla is available at www.lussumo.com
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: File used by Dynamic Data Management object to block/unblock categories
*/
include '../appg/settings.php';
include '../appg/init_ajax.php';
$PostBackKey = ForceIncomingString('PostBackKey', '');
$ExtensionKey = ForceIncomingString('ExtensionKey', '');
if ($PostBackKey != '' && $PostBackKey == $Context->Session->GetVariable('SessionPostBackKey', 'string')) {
    $Block = ForceIncomingBool('Block', 0);
    $BlockCategoryID = ForceIncomingInt('BlockCategoryID', 0);
    if ($BlockCategoryID > 0) {
        $um = $Context->ObjectFactory->NewContextObject($Context, 'UserManager');
        if ($Block) {
            $um->AddCategoryBlock($BlockCategoryID);
        } else {
            $um->RemoveCategoryBlock($BlockCategoryID);
        }
    }
    // Report success
    echo 'Complete';
} else {
    echo $Context->GetDefinition('ErrPostBackKeyInvalid');
}
$Context->Unload();
Esempio n. 23
0
 function InlineImagesForm(&$Context)
 {
     $this->Name = 'InlineImagesForm';
     $this->ValidActions = array('InlineImages', 'ProcessInlineImages');
     $this->Constructor($Context);
     if (!$this->Context->Session->User->Permission('PERMISSION_MANAGE_ATTACHMENTS')) {
         $this->IsPostBack = 0;
     } elseif ($this->IsPostBack) {
         $SettingsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
         $this->ConfigurationManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
         if ($this->PostBackAction == 'ProcessInlineImages') {
             $this->ConfigurationManager->GetSettingsFromForm($SettingsFile);
             $this->ConfigurationManager->DefineSetting('INLINEIMAGES_USE_THICKBOX', ForceIncomingBool('INLINEIMAGES_USE_THICKBOX', 0), 0);
             if ($this->ConfigurationManager->SaveSettingsToFile($SettingsFile)) {
                 header('Location: ' . GetUrl($this->Context->Configuration, 'settings.php', '', '', '', '', 'PostBackAction=InlineImages&Success=1'));
             } else {
                 $this->PostBackAction = 'InlineImages';
             }
         }
     }
     $this->CallDelegate('Constructor');
 }
Esempio n. 24
0
            // Add control to comment form
            $Context->AddToDelegate("DiscussionForm", "CommentForm_PreButtonsRender", "CommentForm_AddAttachmentForm");
            // Upload files on PreSaveComment
            $Context->AddToDelegate("DiscussionForm", "PreSaveComment", "DiscussionForm_UploadAttachments");
            // Upload files on PreSaveDiscussion
            $Context->AddToDelegate("DiscussionForm", "PreSaveDiscussion", "DiscussionForm_UploadAttachments");
            // Save files on PostSaveComment
            $Context->AddToDelegate("DiscussionForm", "PostSaveComment", "DiscussionForm_SaveCommentAttachments");
            // Save files on PostSaveDiscussion
            $Context->AddToDelegate("DiscussionForm", "PostSaveDiscussion", "DiscussionForm_SaveDiscussionAttachments");
        }
    }
    // Handle downloads
    if (ForceIncomingString('PostBackAction', '') == 'Download') {
        $AttachmentID = ForceIncomingInt('AttachmentID', 0);
        $AttachmentManager = $Context->ObjectFactory->NewContextObject($Context, 'AttachmentManager');
        $AttachmentManager->DownloadAttachment($AttachmentID);
    }
    // Remind user to set permissions
    if ($Context->SelfUrl == 'index.php' && !array_key_exists('ATTACHMENTS_NOTICE', $Configuration)) {
        if ($Context->Session->User && $Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) {
            $HideNotice = ForceIncomingBool('TurnOffAttachmentsNotice', 0);
            if ($HideNotice) {
                AddConfigurationSetting($Context, 'ATTACHMENTS_NOTICE', '1');
            } else {
                $NoticeCollector->AddNotice('<span><a href="' . GetUrl($Configuration, 'index.php', '', '', '', '', 'TurnOffAttachmentsNotice=1') . '">' . $Context->GetDefinition('RemoveThisNotice') . '</a></span>
					' . $Context->GetDefinition('RememberToSetAttachmentsPermissions'));
            }
        }
    }
}
 /**
  * Create the Nugget coming from New/Edit Nugget page and save the result back in the file
  */
 function CreateNugget(&$NuggetSettings)
 {
     $Name = ForceIncomingString('Name', '');
     $ID = ForceIncomingInt('ID', 0);
     $HTML = ForceIncomingString('HTML', '');
     $Description = ForceIncomingString('Description', '');
     $Position = ForceIncomingString('Position', '');
     $HideName = ForceIncomingBool('HideName', 0);
     $Weight = ForceIncomingInt('Weight', 0);
     $RoleArr = ForceIncomingArray('AllowedRoles', array());
     $PagesArr = ForceIncomingArray('AllowedPages', array());
     /*while (list(,$Value) = each($PagesArr))
     		{
     			if (!in_array($Value, array("settings.php","search.php","account.php","index.php","comments.php","post.php","categories.php")))
     			{
     				$PagesArr = array_merge($PagesArr, array("extension.php"));
     				break;
     			}
     		}*/
     //so the user won't lose any info on error
     $NuggetSettings->NuggetName = htmlspecialchars($Name);
     $NuggetSettings->NuggetHTML = htmlspecialchars($HTML);
     $NuggetSettings->NuggetID = $ID;
     $NuggetSettings->NuggetPosition = htmlspecialchars($Position);
     $NuggetSettings->NuggetDescription = htmlspecialchars($Description);
     $NuggetSettings->NuggetWeight = $Weight;
     $NuggetSettings->NuggetRoles = $RoleArr;
     $NuggetSettings->NuggetPages = $PagesArr;
     $NuggetSettings->NuggetHideName = $HideName;
     if (!strlen($Name)) {
         $this->Context->WarningCollector->Add($this->Context->GetDefinition('NuggetObj_NoInputValue'));
         return 1;
     }
     if ($ID == '') {
         $ID = 100;
     }
     //arbitrary high number
     for ($i = $f = 0; $i < count($this->Nugget); $i++) {
         if ($this->Nugget[$i]['id'] == $ID && $i != $this->NuggetIndex) {
             $f = 1;
             //Nugget already exists
             break;
         }
     }
     if ($f) {
         //Display error, since nugget already exists.
         $this->Context->WarningCollector->Add($this->Context->GetDefinition('NuggetObj_AlreadyCreated'));
         return 1;
     }
     $NewNugget = array('name' => $Name, 'id' => $ID, 'description' => $Description, 'position' => $Position, 'status' => $Position == '[Frozen]' ? 0 : 1, 'hideName' => $HideName, 'html' => $HTML, 'weight' => $Weight, 'roles' => $RoleArr, 'pages' => $PagesArr);
     if (isset($this->Nugget[$this->NuggetIndex])) {
         //Overwrite existing nugget
         $this->Nugget[$this->NuggetIndex] = $NewNugget;
     } else {
         // Add a new Nugget
         $this->Nugget[count($this->Nugget)] = $NewNugget;
     }
     $this->SaveNugget();
     return 0;
 }
Esempio n. 26
0
 function Configuration()
 {
     // Configuration Settings
     $this->ConfigFile = "_config.xml";
     $this->FileTypesFile = "_filetypes.xml";
     $this->CurrentWorkingDirectory = getcwd();
     // Configuration Properties
     $this->Version = "1.3.3";
     $this->Developer = "Mark O'Sullivan";
     $this->Date = "2002-2005";
     $this->StyleUrl = "_default.css";
     $this->PageTitle = "Lussumo Filebrowser";
     $this->PageIntroduction = "";
     $this->UsePageIntroductionInSubFolders = false;
     $this->DisplayHiddenFiles = false;
     $this->BrowseSubFolders = true;
     $this->SortBy = "Name";
     $this->SortDirection = "asc";
     $this->DateFormat = "m-d-y";
     $this->PluginHeight = 400;
     $this->PluginWidth = 400;
     $this->DefaultFilesPerPage = 5;
     $this->MaxFilesPerPage = 50;
     $this->FitImagesToPage = 1;
     $this->UseThumbnails = 0;
     $this->HideFiles = array();
     $this->FullyQualifiedHideFiles = array();
     // Browsing Properties
     $this->FolderDelimiter = "-";
     $this->FileID = ForceIncomingInt("fid", 0);
     $this->FolderIDs = ForceIncomingString("did", "");
     if ($this->FolderIDs == "") {
         $this->aFolderID = array();
     } else {
         $this->aFolderID = explode($this->FolderDelimiter, $this->FolderIDs);
     }
     $this->CurrentBrowsingDirectory = $this->CurrentWorkingDirectory;
     $this->FolderNavigator = array();
     $this->FolderNavigatorLocation = "";
     $this->ShowMultipleFiles = ForceIncomingBool("smf", false);
     $this->GetFileID = ForceIncomingInt("gid", 0);
     $this->Name = "FileBrowser";
 }
<?php

// Note: This file is included from the library/People/People.Control.SignInForm.php control.
$this->Render_Warnings();
echo '<div id="Form" class="SignInForm">
   <fieldset>';
$this->Render_PostBackForm($this->FormName);
echo '<ul>
   <li>
      <label for="txtUsername">' . $this->Context->GetDefinition('Username') . '</label>
      <input id="txtUsername" type="text" name="Username" value="' . $this->Username . '" class="Input" maxlength="20" />
   </li>
   <li>
      <label for="txtPassword">' . $this->Context->GetDefinition('Password') . '</label>
      <input id="txtPassword" type="password" name="Password" value="" class="Input" />
   </li>
   <li id="RememberMe">
      ' . GetDynamicCheckBox('RememberMe', 1, ForceIncomingBool('RememberMe', 0), '', $this->Context->GetDefinition('RememberMe')) . '
   </li>
</ul>
<div class="Submit"><input type="submit" name="btnSignIn" value="' . $this->Context->GetDefinition('Proceed') . '" class="Button" /></div>
</form>
</fieldset>
<ul class="MembershipOptionLinks">
   <li class="ForgotPasswordLink"><a href="' . GetUrl($this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=PasswordRequestForm') . '">' . $this->Context->GetDefinition('ForgotYourPassword') . '</a></li>
   <li class="ApplyForMembershipLink"><a href="' . GetUrl($this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=ApplyForm') . '">' . $this->Context->GetDefinition('ApplyForMembership') . '</a></li>
</ul>
</div>';
    echo '<fieldset>
         <legend>' . $this->Context->GetDefinition('ThemeAndStyleManagement') . '</legend>
         ' . $this->Get_Warnings() . '
         ' . $this->Get_PostBackForm('frmThemeChange') . '
         <p>' . $this->Context->GetDefinition('ThemeAndStyleNotes') . '</p>
         <ul>';
    if ($this->Context->Session->User->Permission('PERMISSION_MANAGE_THEMES')) {
        $this->PostBackParams->Set('PostBackAction', 'ProcessThemeChange');
        echo '<li>
         <label for="ddTheme">' . $this->Context->GetDefinition('ThemeLabel') . '</label>
         ' . $this->ThemeSelect->Get() . '
      </li>';
    }
    if ($this->Context->Session->User->Permission('PERMISSION_MANAGE_STYLES')) {
        echo '<li>
         <label for="ddStyle">' . $this->Context->GetDefinition('StyleLabel') . '</label>
         ' . $this->StyleSelect->Get() . '
      </li>
      <li>
         <p><span>' . GetDynamicCheckBox('ApplyStyleToUsers', 1, ForceIncomingBool('ApplyStyleToUsers', 0), '', $this->Context->GetDefinition('ApplyStyleToAllUsers')) . '</span></p>
      </li>';
    }
    echo '</ul>
         <div class="Submit">
            <input type="submit" name="btnSave" value="' . $this->Context->GetDefinition('Save') . '" class="Button SubmitButton" />
            <a href="' . GetUrl($this->Context->Configuration, $this->Context->SelfUrl) . '" class="CancelButton">' . $this->Context->GetDefinition('Cancel') . '</a>
         </div>
         </form>
      </fieldset>
   </div>';
}
Esempio n. 29
0
                include '_includes/usersettings.php';
                $Panel->AddListItem($Context->GetDefinition('AccountOptions'), $Context->GetDefinition('Notification'), GetUrl($Configuration, $Context->SelfUrl, "", "", "", "", "u=" . ForceIncomingInt('u', $Context->Session->UserID) . "&amp;PostBackAction=Notification"), "", "", 92);
                $Page->AddRenderControl($Context->ObjectFactory->NewContextObject($Context, "NotificationControl"), $Configuration["CONTROL_POSITION_BODY_ITEM"]);
            }
        }
    }
    $Head->AddStyleSheet('extensions/Notifi/style.css');
}
if (in_array($Context->SelfUrl, array('comments.php', 'index.php', 'account.php', 'categories.php'))) {
    $Head->AddScript('js/prototype.js');
    $Head->AddScript('js/scriptaculous.js');
    $Head->AddScript('extensions/Notifi/functions.js');
}
if ($Context->Session->UserID > 0) {
    mysql_query("UPDATE " . $Context->Configuration['DATABASE_TABLE_PREFIX'] . "User SET Notified = 0 WHERE UserID = '" . $Context->Session->UserID . "'");
}
if ($Context->SelfUrl == "settings.php" && $Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) {
    include '_includes/adminsettings.php';
}
// Remind admin/s to customize settings
if ($Context->SelfUrl == 'index.php' && !array_key_exists('NOTIFI_SETTINGS_NOTICE', $Configuration)) {
    if ($Context->Session->User && $Context->Session->User->Permission('PERMISSION_MANAGE_EXTENSIONS')) {
        $HideNotice = ForceIncomingBool('TurnOffNotifiSettingsNotice', 0);
        if ($HideNotice) {
            AddConfigurationSetting($Context, 'NOTIFI_SETTINGS_NOTICE', '1');
        } else {
            $NoticeCollector->AddNotice('<span><a href="' . GetUrl($Configuration, 'index.php', '', '', '', '', 'TurnOffNotifiSettingsNotice=1') . '">' . $Context->GetDefinition('RemoveThisNotice') . '</a></span>
	    ' . $Context->GetDefinition('RememberToSetNotifiSettingsPermissions'));
        }
    }
}