function Get()
    {
        $sReturn = '<select name="' . $this->Name . '" class="' . $this->CssClass . '" ' . $this->Attributes . '>
		';
        $OptionCount = count($this->aOptions);
        $i = 0;
        for ($i = 0; $i < $OptionCount; $i++) {
            $sReturn .= '<option value="' . FormatStringForDisplay($this->aOptions[$i]['IdValue']) . '" ';
            if (is_array($this->SelectedValue)) {
                $numrows = count($this->SelectedValue);
                for ($j = 0; $j < $numrows; $j++) {
                    if ($this->aOptions[$i]['IdValue'] == $this->SelectedValue[$j]) {
                        $sReturn .= ' selected="selected"';
                        $j = $numrows;
                        // If you've found a match, don't bother looping anymore
                    }
                }
            } else {
                if ($this->aOptions[$i]['IdValue'] == $this->SelectedValue) {
                    $sReturn .= ' selected="selected"';
                }
            }
            if ($this->aOptions[$i]['Attributes'] != '') {
                $sReturn .= $this->aOptions[$i]['Attributes'];
            }
            $sReturn .= '>' . FormatStringForDisplay($this->aOptions[$i]['DisplayValue']) . '</option>
			';
        }
        $sReturn .= '</select>
		';
        return $sReturn;
    }
 function FormatPropertiesForDisplay($IncludeContents = "0")
 {
     $IncludeContents = ForceBool($IncludeContents, 0);
     $this->Label = FormatStringForDisplay($this->Label);
     if ($IncludeContents) {
         $this->Contents = htmlspecialchars($this->Contents);
     }
 }
 function FormatPropertiesForDisplay()
 {
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->AuthFullName = FormatStringForDisplay($this->AuthFullName);
     $this->Name = FormatStringForDisplay($this->Name);
     $this->Url = FormatStringForDisplay($this->Url);
     $this->PreviewImage = FormatStringForDisplay($this->PreviewImage);
 }
 function Render_NoPostBack()
 {
     $this->PostBackParams->Add("PostBackAction", "RequestPasswordReset");
     $this->Render_Warnings();
     $this->Context->Writer->Add("<div class=\"About\">\r\n\t\t\t<h1>" . $this->Context->GetDefinition("AboutYourPassword") . "</h1>\r\n\t\t\t<p>" . $this->Context->GetDefinition("AboutYourPasswordRequestNotes") . "</p>\r\n\t\t\t<p><a href=\"signin.php\">" . $this->Context->GetDefinition("BackToSignInForm") . "</a></p>\r\n\t\t</div>\r\n\t\t<div class=\"Form\">\r\n\t\t\t<h1>" . $this->Context->GetDefinition("PasswordResetRequestForm") . "</h1>\r\n\t\t\t<p>" . $this->Context->GetDefinition("PasswordResetRequestFormNotes") . "</p>");
     $this->Render_PostBackForm($this->FormName);
     $this->Context->Writer->Write("<dl class=\"InputBlock PasswordRequestInputs\">\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=\"" . FormatStringForDisplay($this->Username, 1) . "\" class=\"Input\" maxlength=\"20\" /></dd>\r\n\t\t\t</dl>\r\n\t\t\t<div class=\"FormButtons\"><input type=\"submit\" name=\"btnPassword\" value=\"" . $this->Context->GetDefinition("SendRequest") . "\" class=\"Button\" /></div>\r\n\t\t\t</form>\r\n\t\t</div>");
 }
 function Render_NoPostBack()
 {
     $this->Username = FormatStringForDisplay($this->Username, 1);
     $this->PostBackParams->Add('PostBackAction', 'SignIn');
     $this->PostBackParams->Add('ReturnUrl', $this->ReturnUrl);
     $this->CallDelegate('PreNoPostBackRender');
     include ThemeFilePath($this->Context->Configuration, 'people_signin_form_nopostback.php');
     $this->CallDelegate('PostNoPostBackRender');
 }
 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 FormatPropertiesForDisplay(&$Context)
 {
     $this->Username = FormatStringForDisplay($this->Username, 0);
     $this->FullName = FormatStringForDisplay($this->FullName, 0);
     $this->AdminUsername = FormatStringForDisplay($this->AdminUsername, 0);
     $this->AdminFullName = FormatStringForDisplay($this->AdminFullName, 0);
     $AdminUser = $Context->ObjectFactory->NewContextObject($Context, 'Comment');
     $AdminUser->Clear();
     $AdminUser->AuthUsername = $this->AdminUsername;
     $AdminUser->AuthUserID = $this->AdminUserID;
     $this->Notes = $Context->FormatString($this->Notes, $AdminUser, 'Text', FORMAT_STRING_FOR_DISPLAY);
 }
 function Render_NoPostBack()
 {
     $this->Reporter = FormatStringForDisplay($this->Reporter, 0);
     $this->ReporterEmail = FormatStringForDisplay($this->ReporterEmail, 0);
     $this->BugUrl = FormatStringForDisplay($this->BugUrl, 0);
     $this->BugHappenedWhen = FormatStringForDisplay($this->BugHappenedWhen, 0);
     $this->BugDescription = FormatStringForDisplay($this->BugDescription, 0);
     $this->PostBackParams->Add("PostBackAction", "ReportBug");
     $this->Render_Warnings();
     $this->Context->Writer->Add("<div class=\"Form BugForm\">\r\n\t\t\t" . $this->Context->GetDefinition("AboutBugReport"));
     $this->Render_PostBackForm("frmBugReport");
     $this->Context->Writer->Write("<dl class=\"InputBlock BugReportInputs\">\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("ReporterName") . "</dt>\r\n\t\t\t\t<dd><input type=\"text\" name=\"ReporterName\" value=\"" . $this->Reporter . "\" class=\"BugInput\" maxlength=\"100\" /></dd>\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("ReporterEmail") . "</dt>\r\n\t\t\t\t<dd><input type=\"text\" name=\"ReporterEmail\" value=\"" . $this->ReporterEmail . "\" class=\"BugInput\" maxlength=\"200\" /></dd>\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("BugUrl") . "</dt>\r\n\t\t\t\t<dd><input type=\"text\" name=\"BugUrl\" value=\"" . $this->BugUrl . "\" class=\"BugInput\" maxlength=\"255\" /></dd>\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("BugHappenedWhen") . "</dt>\r\n\t\t\t\t<dd><textarea name=\"BugHappenedWhen\" class=\"BugTextBox\">" . $this->BugHappenedWhen . "</textarea></dd>\r\n\t\t\t\t<dt>" . $this->Context->GetDefinition("BugDescription") . "</dt>\r\n\t\t\t\t<dd><textarea name=\"BugDescription\" class=\"BugTextBox\">" . $this->BugDescription . "</textarea></dd>\r\n\t\t\t</dl>\r\n\t\t\t<div class=\"FormButtons\"><input type=\"submit\" name=\"btnReportBug\" value=\"" . $this->Context->GetDefinition("Submit") . "\" class=\"Button\" /></div>\r\n\t\t\t</form>\r\n\t\t</div>");
 }
 function GetPropertiesFromDataSet($DataSet, &$Context)
 {
     $this->Title = FormatHtmlStringInline(ForceString($DataSet["Name"], ""));
     $this->Link = PrependString("http://", AppendFolder(agDOMAIN, "comments.php?DiscussionID=" . ForceInt($DataSet["DiscussionID"], 0)));
     $this->Id = $this->Link;
     $this->Published = FixDate(@$DataSet["DateCreated"]);
     $this->Updated = FixDate(@$DataSet["DateLastActive"]);
     $this->AuthorName = FormatHtmlStringInline(ForceString($DataSet["AuthUsername"], ""));
     $this->AuthorUrl = PrependString("http://", AppendFolder(agDOMAIN, "account.php?u=" . ForceInt($DataSet["AuthUserID"], 0)));
     $this->Content = $this->RemoveHtml(ForceString(@$DataSet["Body"], ""));
     $this->Summary = SliceString($this->Content, 200);
     $this->Summary = str_replace("\r\n", " ", $this->Content);
     $this->Content = str_replace("\r\n", "<br />", $this->Content);
     if (agUSE_CATEGORIES) {
         $this->Category = FormatStringForDisplay(ForceString($DataSet["Category"], ""), true);
         $this->CategoryLink = "http://" . AppendFolder(agDOMAIN, "?CategoryID=" . ForceInt($DataSet["CategoryID"], 0));
     }
 }
    echo "<h1>Vanilla Installation Wizard (Step 1 of 3)</h1>";
    if ($WarningCollector->Count() > 0) {
        echo "<div class=\"Warnings\">\r\n                  <strong>Oops. We came across some problems while checking your permissions...</strong>\r\n                  " . $WarningCollector->GetMessages() . "\r\n               </div>\r\n               <p>Let's try this again...</p>";
    }
    echo "<p>Before we can do much of anything, we need to make sure that you've got your directory &amp; file permissions set up properly.</p>\r\n               <p>Vanilla is going to need read AND write access to the following files:</p>\r\n               <ul>\r\n                  <li>" . $WorkingDirectory . "appg/settings.php</li>\r\n                  <li>" . $WorkingDirectory . "appg/extensions.php</li>\r\n                  <li>" . $WorkingDirectory . "appg/language.php</li>\r\n                  <li>" . $WorkingDirectory . "database.sql</li>\r\n               </ul>\r\n               <p>Vanilla is also going to need read access to the following folder:</p>\r\n               <ul>\r\n                  <li>" . $WorkingDirectory . "languages/</li>\r\n               </ul>\r\n               <p>And finally, the filebrowser and thumbnailer will need read AND write access to the following folder:</p>\r\n               <ul>\r\n                  <li>" . $WorkingDirectory . "images/</li>\r\n               </ul>\r\n               <p>If you are running a *nix server and you have command line access, you can achieve these permissions by navigating to the Vanilla folder. Once you are sitting in the same folder as the installer.php file, run the following commands:</p>\r\n               <blockquote>\r\n                  <code>\r\n                     chmod 666 appg/settings.php\r\n                     <br />chmod 666 appg/language.php\r\n                     <br />chmod 666 appg/extensions.php\r\n                     <br />chmod 666 database.sql\r\n                     <br />chmod 757 images/\r\n                  </code>\r\n               </blockquote>\r\n               <p>Once you've got your permissions set up properly...</p>\r\n               <div class=\"Button\"><a href=\"installer.php?PostBackAction=Permissions\">Click here to check your permissions and proceed to the next step</a></div>";
} elseif ($CurrentStep == 2) {
    echo "<h1>Vanilla Installation Wizard (Step 2 of 3)</h1>";
    if ($WarningCollector->Count() > 0) {
        echo "<div class=\"Warnings\">\r\n                  <strong>Oops. We came across some problems while setting up Vanilla...</strong>\r\n                  " . $WarningCollector->GetMessages() . "\r\n               </div>\r\n               <p>Let's try this again...</p>";
    }
    echo "<p>Below you can provide the connection parameters for the mysql server where you want to install Vanilla. If you haven't done it yet, now would be a good time to create the database where you want Vanilla installed.</p>\r\n            <form name=\"frmDatabase\" method=\"post\" action=\"installer.php\">\r\n            <input type=\"hidden\" name=\"PostBackAction\" value=\"Database\" />\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>MySQL Server</dt>\r\n                  <dd><input type=\"text\" name=\"DBHost\" value=\"" . FormatStringForDisplay($DBHost, 1) . "\" /></dd>\r\n                  <dt>MySQL Database Name</dt>\r\n                  <dd><input type=\"text\" name=\"DBName\" value=\"" . FormatStringForDisplay($DBName, 1) . "\" /></dd>\r\n                  <dt>MySQL User</dt>\r\n                  <dd><input type=\"text\" name=\"DBUser\" value=\"" . FormatStringForDisplay($DBUser, 1) . "\" /></dd>\r\n                  <dt>MySQL Password</dt>\r\n                  <dd><input type=\"password\" name=\"DBPass\" value=\"" . FormatStringForDisplay($DBPass, 1) . "\" /></dd>\r\n               </dl>\r\n            </div>\r\n            </form>\r\n            <div class=\"Button\"><a href=\"javascript:document.frmDatabase.submit();\">Click here to create Vanilla's database tables and proceed to the next step</a></div>";
} elseif ($CurrentStep == 3) {
    if ($PostBackAction != "User") {
        $CookieDomain = ForceString(@$_SERVER['HTTP_HOST'], "");
    }
    echo "<h1>Vanilla Installation Wizard (Step 3 of 3)</h1>";
    if ($WarningCollector->Count() > 0) {
        echo "<div class=\"Warnings\">\r\n                  <strong>Oops. We came across some problems while setting up Vanilla...</strong>\r\n                  " . $WarningCollector->GetMessages() . "\r\n               </div>";
    }
    echo "<p>Now let's set up your administrative account for Vanilla.</p>\r\n            <form name=\"frmUser\" method=\"post\" action=\"installer.php\">\r\n            <input type=\"hidden\" name=\"PostBackAction\" value=\"User\" />\r\n            <input type=\"hidden\" name=\"DBHost\" value=\"" . FormatStringForDisplay($DBHost) . "\" />\r\n            <input type=\"hidden\" name=\"DBName\" value=\"" . FormatStringForDisplay($DBName) . "\" />\r\n            <input type=\"hidden\" name=\"DBUser\" value=\"" . FormatStringForDisplay($DBUser) . "\" />\r\n            <input type=\"hidden\" name=\"DBPass\" value=\"" . FormatStringForDisplay($DBPass) . "\" />\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>Username</dt>\r\n                  <dd><input type=\"text\" name=\"Username\" value=\"" . FormatStringForDisplay($Username, 1) . "\" /></dd>\r\n                  <dt>Password</dt>\r\n                  <dd><input type=\"password\" name=\"Password\" value=\"" . FormatStringForDisplay($Password, 1) . "\" /></dd>\r\n                  <dt>Confirm Password</dt>\r\n                  <dd><input type=\"password\" name=\"ConfirmPassword\" value=\"" . FormatStringForDisplay($ConfirmPassword, 1) . "\" /></dd>\r\n               </dl>\r\n            </div>\r\n            <p>Up next we've got to set up the support contact information for your forum. This is what people will see when support emails go out from the system for things like password retrieval and role changes.</p>\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>Support Contact Name</dt>\r\n                  <dd><input type=\"text\" name=\"SupportName\" value=\"" . FormatStringForDisplay($SupportName, 1) . "\" /></dd>\r\n                  <dt>Support Email Address</dt>\r\n                  <dd><input type=\"text\" name=\"SupportEmail\" value=\"" . FormatStringForDisplay($SupportEmail, 1) . "\" /></dd>\r\n               </dl>\r\n            </div>\r\n            <p>What do you want to call your forum?</p>\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>Forum Name</dt>\r\n                  <dd><input type=\"text\" name=\"ApplicationTitle\" value=\"" . FormatStringForDisplay($ApplicationTitle, 1) . "\" /></dd>\r\n               </dl>\r\n            </div>\r\n            <p>When members use the \"remember me\" feature of the sign in form, we assign a cookie to their browser. That cookie is normally associated with your domain name, but you may want to associate it with something else like the sub-folder in which Vanilla resides (if Vanilla is in a sub-folder). Specify your cookie domain here.</p>\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>Cookie Domain</dt>\r\n                  <dd><input type=\"text\" name=\"CookieDomain\" value=\"" . FormatStringForDisplay($CookieDomain, 1) . "\" /></dd>\r\n               </dl>\r\n            </div>\r\n            <p>Finally, select the language you want Vanilla to use. If you don't see your language here, you should " . GetEmail("*****@*****.**", "contact us") . " about setting up a Vanilla dictionary for your language!</p>\r\n            <div class=\"Form\">\r\n               <dl>\r\n                  <dt>Language</dt>\r\n                  <dd>" . $LanguageSelect->Get() . "</dd>\r\n               </dl>\r\n            </div>\r\n            </form>\r\n            <div class=\"Button\"><a href=\"javascript:document.frmUser.submit();\">Click here to complete the setup process!</a></div>";
} else {
    echo "<h1>Vanilla Installation Wizard (Complete)</h1>\r\n            <p><strong>That's it!</strong></p>\r\n            <p>Vanilla is set up and ready to go, so what do you do next?</p>\r\n            <p>Before you start inviting your friends in for discussions, there are a lot of other things you might want to set up. For example, in the settings tab, you can:</p>\r\n            <ul>\r\n               <li>\r\n                  Turn some of the extensions on, like...\r\n                  <ul>\r\n                     <li>The category quick-jump that allows members to jump between categories from their control panel</li>\r\n                     <li>The clipboard that allows members to quickly paste snippets of information into their comments</li>\r\n                     <li>The Html Formatter that allows members to use a limited set of html when adding their comments to discussions</li>\r\n                     <li>And lots more!</li>\r\n                  </ul>\r\n               </li>\r\n               <li>\r\n                  Fine-tune application settings like...\r\n                  <ul>\r\n                     <li>Change the number of discussions or comments per page</li>\r\n                     <li>Allow the public to browse your forum without an account</li>\r\n                     <li>Disable discussion categories and run your forum as one giant discussion container</li>\r\n                     <li>Allow your members to change their usernames at will</li>\r\n                     <li>Much, much more!</li>\r\n                  </ul>\r\n               </li>\r\n               <li>Create new roles with various different permissions</li>\r\n               <li>Create new categories, and even limit which roles get to access them</li>\r\n               <li>Allow new users to be automatically granted access when they apply for membership</li>\r\n            </ul>\r\n            <p>And that's not all. There's also the latest version of the Lussumo Filebrowser and Thumbnailer sitting in your images folder.</p>\r\n            <div class=\"Button\"><a href=\"signin.php\">Go sign in and have some fun!</a></div>";
}
?>
         </div>
      </div>
      <div class="Foot">
         <a href="http://lussumo.com">Lussumo</a> <a href="http://getvanilla.com">Vanilla</a> & <a href="http://thefilebrowser.com">Filebrowser</a> Copyright &copy; 2001 - 2005
      </div>   
   </body>
</html>
function GetRequestUri()
{
    global $Configuration;
    $Host = ForceString($_SERVER['HTTP_HOST'], '');
    if ($Host != '') {
        $Host = PrependString($Configuration['HTTP_METHOD'] . '://', $Host);
    }
    $Path = @$_SERVER['REQUEST_URI'];
    // If the path wasn't provided in the REQUEST_URI variable, let's look elsewhere for it
    if ($Path == '') {
        $Path = @$_SERVER['HTTP_X_REWRITE_URL'];
    }
    // Some servers use this instead
    // If the path still wasn't found, let's try building it with other variables
    if ($Path == '') {
        $Path = @$_SERVER['SCRIPT_NAME'];
        $Path .= @$_SERVER['QUERY_STRING'] == '' ? '' : '?' . @$_SERVER['QUERY_STRING'];
    }
    $FullPath = ConcatenatePath($Host, $Path);
    return FormatStringForDisplay($FullPath);
}
Example #12
0
// Create the comment grid
$Post = $Context->ObjectFactory->NewContextObject($Context, "Post");
$Post->Title = $Context->GetDefinition("StartANewDiscussion");
// Create the comment form
$CommentForm = $Context->ObjectFactory->NewContextObject($Context, "DiscussionForm");
$CommentForm->LoadData();
// Only people with active sessions can post
if ($Context->Session->UserID == 0) {
    $Context->WarningCollector->Add($this->Context->GetDefinition("ErrSignInToDiscuss"));
    $CommentForm->FatalError = 1;
}
// Define properties of the page controls that are specific to this page
$Menu->CurrentTab = "discussions";
$Panel->CssClass = "PostPanel";
$Body->CssClass = "StartDiscussion";
$Context->PageTitle = FormatStringForDisplay($CommentForm->Discussion->Name, 1);
if ($Context->PageTitle == "") {
    $Context->PageTitle = $Context->GetDefinition("StartANewDiscussion");
} else {
    if ($CommentForm->CommentID == 0) {
        $Post->Title = $Context->GetDefinition("AddYourComments");
    } elseif ($CommentForm->CommentID > 0) {
        $Post->Title = $Context->GetDefinition("EditComments");
    } else {
        $Post->Title = $Context->GetDefinition("EditDiscussion");
    }
}
// 2. BUILD PAGE CONTROLS
// Build the control panel
$Panel->AddListItem($Context->GetDefinition("Options"), $Context->GetDefinition("BackToDiscussions"), "./");
AddDiscussionOptionsToPanel($Context, $Panel);
Example #13
0
        $cs->Attributes .= ' id="ddCategories"';
        if ($CategoryID > 0) {
            echo '<input type=hidden name=CategoryID value=' . $CategoryID . ' />';
        }
    } else {
        echo '<input type="hidden" name="CategoryID" value="' . $cs->aOptions[0]['IdValue'] . '" />';
    }
    $this->CallDelegate('DiscussionForm_PreTopicRender');
    echo '<li>
		<label for="txtTopic">' . $this->Context->GetDefinition($Discussion->DiscussionID == 0 ? 'EnterYourDiscussionTopic' : 'EditYourDiscussionTopic') . '</label>
		<input id="txtTopic" type="text" name="Name" class="DiscussionBox" maxlength="100" value="' . $Discussion->Name . '" />
	</li>';
    if ($this->Context->Configuration['ENABLE_WHISPERS'] && $Discussion->DiscussionID == 0) {
        echo '<li>
			<label for="WhisperUsername">' . $this->Context->GetDefinition('WhisperYourCommentsTo') . '</label>
			<input id="WhisperUsername" name="WhisperUsername" type="text" value="' . FormatStringForDisplay($Discussion->WhisperUsername, 0) . '" class="Whisper AutoCompleteInput" maxlength="20" />
			<script type="text/javascript">
				var WhisperAutoComplete = new AutoComplete("WhisperUsername", false);
				WhisperAutoComplete.TableID = "WhisperAutoCompleteResults";
				WhisperAutoComplete.KeywordSourceUrl = "' . $this->Context->Configuration['WEB_ROOT'] . 'ajax/getusers.php?Search=";
			</script>
		</li>
		';
    }
    $this->CallDelegate('DiscussionForm_PreCommentRender');
    echo '<li>
		<label for="CommentBox">
			<a href="./" id="CommentBoxController" onclick="' . "ToggleCommentBox('" . $this->Context->Configuration['WEB_ROOT'] . "ajax/switch.php', '" . $this->Context->GetDefinition('SmallInput') . "', '" . $this->Context->GetDefinition('BigInput') . "', '" . $this->Context->Session->GetCsrfValidationKey() . "'); return false;" . '">' . $this->Context->GetDefinition($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'SmallInput' : 'BigInput') . '</a>';
    $this->CallDelegate('DiscussionForm_PostCommentToggle');
    echo $this->Context->GetDefinition('EnterYourComments') . '
		</label>
<?php

// Note: This file is included from the library/People/People.Control.PasswordRequestForm.php control.
echo '<div class="About">
	<h2>' . $this->Context->GetDefinition('AboutYourPassword') . '</h2>
	<p>' . $this->Context->GetDefinition('AboutYourPasswordRequestNotes') . '</p>
	<p><a href="' . GetUrl($this->Context->Configuration, $this->Context->SelfUrl) . '">' . $this->Context->GetDefinition('BackToSignInForm') . '</a></p>
</div>
<div id="Form" class="PasswordRequestForm">
	<fieldset>
		<legend>' . $this->Context->GetDefinition('PasswordResetRequestForm') . '</legend>
		<p>' . $this->Context->GetDefinition('PasswordResetRequestFormNotes') . '</p>';
$this->Render_Warnings();
$this->Render_PostBackForm($this->FormName);
echo '<ul>
	<li>
		<label for="txtUsername">' . $this->Context->GetDefinition('Username') . '</label>
		<input id="txtUsername" type="text" name="Username" value="' . FormatStringForDisplay($this->Username, 1) . '" class="Input" maxlength="20" />
	</li>
</ul>
<div class="Submit"><input type="submit" name="btnPassword" value="' . $this->Context->GetDefinition('SendRequest') . '" class="Button" /></div>
</form>
</fieldset>
</div>';
 function NuggetForm(&$Context)
 {
     global $NuggetObj;
     $this->ValidActions = array('NuggetList', 'Nugget', 'RemoveNugget', 'ProcessNugget', 'ProcessNuggetList', 'ProcessRemoveNugget');
     $this->Constructor($Context);
     if (in_array($this->PostBackAction, array('ProcessNugget', 'Nugget')) || !is_array($NuggetObj->Nugget)) {
         //get the role data
         $RoleMng = $this->Context->ObjectFactory->NewContextObject($Context, 'RoleManager');
         $RoleData = $RoleMng->GetRoles();
         if ($RoleData) {
             $NuggetObj->Roles[] = array('ID' => 0, 'Name' => $this->Context->GetDefinition('Unathenticated'));
             while ($Row = $this->Context->Database->GetRow($RoleData)) {
                 $NuggetObj->Roles[] = array('ID' => $Row['RoleID'], 'Name' => FormatStringForDisplay($Row['Name']));
             }
         }
     }
     if ($this->IsPostBack) {
         if ($this->PostBackAction == 'ProcessNugget' && $this->IsValidFormPostBack()) {
             if (!$NuggetObj->CreateNugget($this)) {
                 header('Location: ' . $this->Context->Configuration['WEB_ROOT'] . 'settings.php?PostBackAction=NuggetList');
             }
         } else {
             if ($this->PostBackAction == 'ProcessNuggetList' && $this->IsValidFormPostBack()) {
                 if (!$NuggetObj->SaveNuggetList()) {
                     header('Location: ' . $this->Context->Configuration['WEB_ROOT'] . 'settings.php?PostBackAction=NuggetList');
                 }
             } else {
                 if ($this->PostBackAction == 'ProcessRemoveNugget' && $this->IsValidFormPostBack()) {
                     $NuggetObj->RemoveNugget();
                     header('Location: ' . $this->Context->Configuration['WEB_ROOT'] . 'settings.php?PostBackAction=NuggetList');
                 }
             }
         }
         if (in_array($this->PostBackAction, array('Nugget', 'ProcessNugget', 'RemoveNugget'))) {
             // Generate Nugget select fields.
             $this->NuggetSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
             $this->NuggetSelect->Name = 'NuggetID';
             $this->NuggetSelect->CssClass = 'SmallInput';
             $this->NuggetSelect->Attributes = 'id="nuggetselect"';
             for ($i = 0; $i < count($NuggetObj->Nugget); $i++) {
                 $this->NuggetSelect->AddOption($NuggetObj->Nugget[$i]['id'], $NuggetObj->Nugget[$i]['name']);
             }
             if ($this->PostBackAction != 'RemoveNugget') {
                 $this->NuggetSelect->AddOption('', $this->Context->GetDefinition('[Create Nugget]'));
             }
         }
         if (in_array($this->PostBackAction, array('NuggetList', 'ProcessNuggetList', 'Nugget', 'ProcessNugget'))) {
             // Generate Weight select fields.
             $this->WeightSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
             $this->WeightSelect->Name = 'Weight';
             $this->WeightSelect->CssClass = 'WeightSelect SmallInput';
             for ($i = $NuggetObj->Weight['min']; $i <= $NuggetObj->Weight['max']; $i++) {
                 $this->WeightSelect->AddOption($i, $i);
             }
             // Generate Position select fields.
             $this->PositionSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
             $this->PositionSelect->Name = 'Position';
             $this->PositionSelect->CssClass = 'PositionSelect SmallInput';
             for ($i = 0; $i < count($NuggetObj->Position); $i++) {
                 $this->PositionSelect->AddOption($NuggetObj->Position[$i]['position'], $NuggetObj->Position[$i]['name']);
             }
         }
     }
 }
Example #16
0
* Contact Mark O'Sullivan at mark [at] lussumo [dot] com
*
* Description: File used by Dynamic Data Management object to fill autocomplete data on user input field
*/
include '../appg/settings.php';
include '../appg/init_ajax.php';
$Search = ForceIncomingString('Search', '');
$Search = urldecode($Search);
$Search = FormatStringForDatabaseInput($Search);
if ($Search != '') {
    $s = $Context->ObjectFactory->NewContextObject($Context, 'SqlBuilder');
    $s->SetMainTable('User', 'u');
    $s->AddSelect('Name', 'u');
    $s->AddWhere('u', 'Name', '', $Search . '%', 'like');
    $s->AddOrderBy('Name', 'u', 'asc');
    $s->AddLimit(0, 10);
    $ResultSet = $Context->Database->Select($s, 'Ajax', 'AutoComplete', 'An error occurred while retrieving autocomplete items.', 0);
    $Name = '';
    $Loop = 1;
    if ($ResultSet) {
        while ($row = $Context->Database->GetRow($ResultSet)) {
            if ($Loop > 1) {
                echo ',';
            }
            $Name = FormatStringForDisplay($row['Name'], 1);
            echo $Name;
            $Loop++;
        }
    }
}
$Context->Unload();
Example #17
0
 /**
  * Render the extension settings form.
  * 
  * Look for a template in the theme path to render. If none exists, the
  * template in SetList's extension directory is used.
  */
 function Render()
 {
     if ($this->IsPostBack) {
         $this->CallDelegate('PreRender');
         // Stick the hidden form elements into post back params.
         foreach ($this->formData['elements'] as $key => $elem) {
             if ('hidden' == $elem['type'] && !$elem['norender']) {
                 $value = FormatStringForDisplay($elem['value'], false, true);
                 $this->PostBackParams->Set($key, $value, 0, '', 0);
             }
         }
         // If a themed version of the settings form exists, use it.
         $templateFile = 'settings_setlist_form.php';
         if (file_exists($this->Context->Configuration['THEME_PATH'] . $templateFile)) {
             $templateFile = $this->Context->Configuration['THEME_PATH'] . $templateFile;
         } else {
             $templateFile = $this->Context->Configuration['APPLICATION_PATH'] . 'extensions/SetList/' . $templateFile;
         }
         include $templateFile;
         $this->CallDelegate('PostRender');
     }
 }
Example #18
0
<?php

// Note: This file is included from the library/Vanilla/Vanilla.Control.Menu.php class.
$this->CallDelegate('PreHeadRender');
echo '
	<div id="Header">
		<div id="Session">
';
if ($this->Context->Session->UserID > 0) {
    echo str_replace('//1', $this->Context->Session->User->Name, $this->Context->GetDefinition('SignedInAsX')) . ' (<a href="' . FormatStringForDisplay(AppendUrlParameters($this->Context->Configuration['SIGNOUT_URL'], 'FormPostBackKey=' . $this->Context->Session->GetCsrfValidationKey())) . '">' . $this->Context->GetDefinition('SignOut') . '</a>)';
} else {
    echo $this->Context->GetDefinition('NotSignedIn') . ' (<a href="' . FormatStringForDisplay(AppendUrlParameters($this->Context->Configuration['SIGNIN_URL'], 'ReturnUrl=' . urlencode(GetRequestUri(0)))) . '">' . $this->Context->GetDefinition('SignIn') . '</a> or
		<a href="' . FormatStringForDisplay(AppendUrlParameters($this->Context->Configuration['REGISTRATION_URL'], 'ReturnUrl=' . urlencode(GetRequestUri(0)))) . '">' . $this->Context->GetDefinition('Register') . '</a>)';
}
echo '
	</div>
	<a name="pgtop"></a>
	<h1>
		' . $this->Context->Configuration['BANNER_TITLE'] . '
	</h1>
	<ul>
';
while (list($Key, $Tab) = each($this->Tabs)) {
    echo '<li' . $this->TabClass($this->CurrentTab, $Tab['Value']) . '><a href="' . $Tab['Url'] . '" ' . $Tab['Attributes'] . '>' . $Tab['Text'] . '</a></li>';
}
echo '
	</ul>
</div>
';
$this->CallDelegate('PreBodyRender');
echo '<div id="Body">';
 function FormatPropertiesForDisplay()
 {
     $this->Label = FormatStringForDisplay($this->Label);
     $this->Keywords = FormatStringForDisplay($this->Keywords);
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->Query = FormatStringForDisplay($this->Query);
 }
Example #20
0
function PreviewPostButton(&$Form)
{
    $Context = $Form->Context;
    $User = $Context->Session->User;
    printf('<input type="button" name="btnPreview" value="%s" ' . 'class="Button SubmitButton PreviewButton" ' . 'onclick="showpreview(\'%s\', {id: %d, name: \'%s\'});" />', $Context->GetDefinition('PreviewPost'), $Context->Configuration['BASE_URL'], $User->UserID, !empty($User->Name) ? FormatStringForDisplay($User->Name) : 'Guest');
}
 function FormatPropertiesForSafeDisplay()
 {
     // Make sure to pass the body through global string formatters
     $this->Body = $this->Context->StringManipulator->GlobalParse($this->Body, $this, FORMAT_STRING_FOR_DISPLAY);
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->EditUsername = FormatStringForDisplay($this->EditUsername);
     $this->DeleteUsername = FormatStringForDisplay($this->DeleteUsername);
     $this->WhisperUsername = FormatStringForDisplay($this->WhisperUsername);
     $this->Discussion = FormatStringForDisplay($this->Discussion);
     $this->Category = FormatStringForDisplay($this->Category);
     $this->Body = FormatHtmlStringInline($this->Body, 0, 1);
     $this->AuthIcon = FormatStringForDisplay($this->AuthIcon, 1, 0);
     $this->CallDelegate('PostFormatPropertiesForSafeDisplay');
 }
 function FormatPropertiesForDisplay()
 {
     $this->AuthFullName = FormatStringForDisplay($this->AuthFullName);
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->LastFullName = FormatStringForDisplay($this->LastFullName);
     $this->LastUsername = FormatStringForDisplay($this->LastUsername);
     $this->Category = FormatStringForDisplay($this->Category);
     $this->Name = FormatStringForDisplay($this->Name);
 }
 function FormatPropertiesForDisplay()
 {
     $this->WhisperUsername = FormatStringForDisplay($this->WhisperUsername);
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->LastUsername = FormatStringForDisplay($this->LastUsername);
     $this->Category = FormatStringForDisplay($this->Category);
     $this->Name = FormatStringForDisplay($this->Name, 0);
     $this->CallDelegate('PostFormatPropertiesForDisplay');
 }
 function Render()
 {
     foreach ($this->Context->JSDictionary as $Key => $Value) {
         $Key = 'X-Vanilla-' . FormatStringForDisplay($Key);
         $Value = FormatStringForDisplay($Value);
         $this->Meta[$Key] = $Value;
     }
     // Can be used to replace css and script
     // e.g. Replace assets by ones from a CDN
     $this->CallDelegate('FilterAssets');
     // Sort the stylesheets
     if (is_array($this->StyleSheets)) {
         ksort($this->StyleSheets);
     }
     $this->CallDelegate('PackAssets');
     // Set $this->Scripts
     if (is_array($this->_Scripts)) {
         asort($this->_Scripts, SORT_NUMERIC);
         $this->Scripts = array_keys($this->_Scripts);
     }
     $this->CallDelegate('GetTags');
     $this->TagAssets();
     $this->CallDelegate('PreRender');
     include ThemeFilePath($this->Context->Configuration, 'head.php');
     include ThemeFilePath($this->Context->Configuration, 'overall_header.php');
     $this->CallDelegate('PostRender');
 }
 function FormatPropertiesForSafeDisplay()
 {
     $this->AuthFullName = FormatStringForDisplay($this->AuthFullName);
     $this->AuthUsername = FormatStringForDisplay($this->AuthUsername);
     $this->EditFullName = FormatStringForDisplay($this->EditFullName);
     $this->EditUsername = FormatStringForDisplay($this->EditUsername);
     $this->DeleteFullName = FormatStringForDisplay($this->DeleteFullName);
     $this->DeleteUsername = FormatStringForDisplay($this->DeleteUsername);
     $this->WhisperUsername = FormatStringForDisplay($this->WhisperUsername);
     $this->Discussion = FormatStringForDisplay($this->Discussion);
     $this->Category = FormatStringForDisplay($this->Category);
     $this->Body = FormatHtmlStringInline($this->Body);
     $this->AuthIcon = FormatStringForDisplay($this->AuthIcon);
 }
 function FormatPropertiesForDisplay()
 {
     $this->Username = FormatStringForDisplay($this->Username, 1);
     $this->Password = '';
 }
Example #27
0
								<label for="tSupportEmail">Support Email Address</label>
								<input id="tSupportEmail" type="text" name="SupportEmail" value="' . FormatStringForDisplay($SupportEmail, 1) . '" />
							</li>
						</ul>
						<p>What do you want to call your forum?</p>
						<ul>
							<li>
								<label for="tApplicationTitle">Forum Name</label>
								<input id="tApplicationTitle" type="text" name="ApplicationTitle" value="' . FormatStringForDisplay($ApplicationTitle, 1) . '" />
							</li>
						</ul>' . "<p>The cookie domain is where you want cookies assigned to for Vanilla. Typically the cookie domain will be something like www.yourdomain.com. Cookies can be further defined to a particular path on your website using the \"Cookie Path\" setting. (TIP: If you want your Vanilla cookies to apply to all subdomains of your domain, use \".yourdomain.com\" as the cookie domain).</p>" . '<ul>
							<li>
								<label for="tCookieDomain">Cookie Domain</label>
								<input id="tCookieDomain" type="text" name="CookieDomain" value="' . FormatStringForDisplay($CookieDomain, 1) . '" />
							</li>
							<li>
								<label for="tCookiePath">Cookie Path</label>
								<input id="tCookiePath" type="text" name="CookiePath" value="' . FormatStringForDisplay($CookiePath, 1) . '" />
							</li>
						</ul>
						<div class="Button"><input type="submit" value="Click here to complete the setup process!" /></div>
						</form>
					</fieldset>';
} else {
    echo "<h2>Vanilla Upgrade Wizard (Complete)</h2>\r\n\t\t\t\t\t<p><strong>That's it! Vanilla has been upgraded.</strong></p>\r\n\t\t\t\t\t<p>Things in Vanilla 1 are quite different to what you're used to. The best new feature is, without a doubt, the new extension engine. You should definitely head over to the <a href=\"http://lussumo.com/addons/\" target=\"Lussumo\">Vanilla Add-on directory</a> right away to find all of your favourite old extensions, plus a bunch of new ones.</p>\r\n\t\t\t\t\t<p>Of course you will also want to go make sure your application was upgraded properly. Here are a few things you should take a look at:</p>\r\n\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t<li>Public &amp; Private browsing on the Registration Management Form</li>\r\n\t\t\t\t\t\t<li>On public forums, make sure that the unauthenticated role has access to all public discussion categories</li>\r\n\t\t\t\t\t</ul>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<p>If you find that there was some unforseen problem with the upgrade procedure, visit <a href=\"http://lussumo.com/community/\" target=\"Lussumo\">Lussumo Community Forum</a> for help.</p>\r\n\t\t\t\t\t<div class=\"Button\"><a href=\"../people.php\">Go sign in and have some fun!</a></div>";
}
?>
			</div>
		</div>
   </body>
</html>
 function FormatPropertiesForDisplay()
 {
     $this->Name = FormatStringForDisplay($this->Name, 1);
     $this->Description = FormatStringForDisplay($this->Description, 1);
 }
 function RequestPasswordReset($Username)
 {
     $Username = FormatStringForDatabaseInput($Username, '');
     $Email = false;
     if ($Username == '') {
         $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrInvalidUsername'));
     } else {
         // Attempt to retrieve email address
         $s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
         $s->SetMainTable('User', 'u');
         $s->AddSelect(array('Email', 'Name', 'UserID'), 'u');
         $s->AddWhere('u', 'Name', '', $Username, '=');
         $UserResult = $this->Context->Database->Select($s, $this->Name, 'RequestPasswordReset', 'An error occurred while retrieving account information.');
         if ($this->Context->Database->RowCount($UserResult) == 0) {
             $this->Context->WarningCollector->Add($this->Context->GetDefinition('ErrAccountNotFound'));
         } else {
             $Name = '';
             $Email = '';
             $UserID = 0;
             while ($rows = $this->Context->Database->GetRow($UserResult)) {
                 $UserID = ForceInt($rows['UserID'], 0);
                 $Email = ForceString($rows['Email'], '');
                 $Name = FormatStringForDisplay($rows['Name'], 1);
             }
             // Now that we have the email, generate an email verification key
             $EmailVerificationKey = DefineVerificationKey();
             // Insert the email verification key into the user table
             $s->Clear();
             $s->SetMainTable('User', 'u');
             $s->AddFieldNameValue('EmailVerificationKey', $EmailVerificationKey, 1);
             $s->AddWhere('u', 'UserID', '', $UserID, '=');
             $this->Context->Database->Update($s, $this->Name, 'RequestPasswordReset', 'An error occurred while managing your account information.');
             // If there are no errors, send the user an email
             if ($this->Context->WarningCollector->Count() == 0) {
                 // Retrieve the email body
                 $File = $this->Context->Configuration['LANGUAGES_PATH'] . $this->Context->Configuration['LANGUAGE'] . '/email_password_request.txt';
                 $EmailBody = @file_get_contents($File);
                 if (!$EmailBody) {
                     $this->Context->ErrorManager->AddError($this->Context, $this->Name, 'AssignRole', 'Failed to read email template (' . $File . ').');
                 }
                 $e = $this->Context->ObjectFactory->NewContextObject($this->Context, 'Email');
                 $e->HtmlOn = 0;
                 $e->WarningCollector =& $this->Context->WarningCollector;
                 $e->ErrorManager =& $this->Context->ErrorManager;
                 $e->AddFrom($this->Context->Configuration['SUPPORT_EMAIL'], $this->Context->Configuration['SUPPORT_NAME']);
                 $e->AddRecipient($Email, $Name);
                 $e->Subject = $this->Context->Configuration['APPLICATION_TITLE'] . ' ' . $this->Context->GetDefinition('PasswordResetRequest');
                 $e->Body = str_replace(array('{user_name}', '{forum_name}', '{password_url}'), array($Name, $this->Context->Configuration['APPLICATION_TITLE'], ConcatenatePath($this->Context->Configuration['BASE_URL'], GetUrl($this->Context->Configuration, 'people.php', '', '', '', '', 'PostBackAction=PasswordResetForm&u=' . $UserID . '&k=' . $EmailVerificationKey))), $EmailBody);
                 $e->Send();
             }
         }
     }
     return $this->Context->WarningCollector->Iif($Email, false);
 }
/**
 * Redirect to an other page
 *
 * @todo Should the Location be encoded in function?
 * @param string $Location Absolute URL
 * @param string $Code Status code
 * @param string $Name Name of the page
 * @param bool $Die Should the script terminate
 * @return void
 */
function Redirect($Location, $Code = '302', $Name = '', $Die = 1)
{
    // Set status
    $CodeList = array('301' => 'Moved Permanently', '303' => 'See Other');
    if ($Code && array_key_exists($Code, $CodeList)) {
        Header('HTTP/1.1 ' . $Code . ' ' . $CodeList[$Code]);
    }
    //Strip CRLFs and replace &amp; with & (case insensitive)
    $Location = preg_replace(array('/\\r\\n/', '/&amp;/i'), array('', '&'), $Location);
    //$Location have to be well encoded.
    header('Location: ' . $Location);
    if ($Die) {
        @ob_end_clean();
        if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
            if (!$Name) {
                $Name = $Location;
            }
            // display a lick in case the redirect fails
            echo '<a href="' . $Location . '">' . FormatStringForDisplay($Name) . '</a>';
        }
        //global $Context;
        //$Context->Unload();
        die;
    }
}