作者:jara
项目:opencongres
function PasswordResetForm(&$Context, $FormName = '')
{
$this->Name = 'PasswordResetForm';
$this->ValidActions = array('PasswordResetForm', 'ResetPassword');
$this->Constructor($Context);
if ($this->IsPostBack) {
$this->FormName = $FormName;
$this->ValidatedCredentials = 0;
// Set up the page
global $Banner, $Foot;
$Banner->Properties['CssClass'] = 'PasswordReset';
$Foot->CssClass = 'PasswordReset';
$this->Context->PageTitle = $this->Context->GetDefinition('ResetYourPassword');
// Form properties
$this->UserID = ForceIncomingInt('u', 0);
$this->EmailVerificationKey = ForceIncomingString('k', '');
$this->NewPassword = ForceIncomingString('NewPassword', '');
$this->ConfirmPassword = ForceIncomingString('ConfirmPassword', '');
$this->CallDelegate('Constructor');
$um = $this->Context->ObjectFactory->NewContextObject($this->Context, 'UserManager');
if ($this->IsPostBack && $this->PostBackAction == 'ResetPassword') {
$this->ValidatedCredentials = 1;
} else {
$this->ValidatedCredentials = $um->VerifyPasswordResetRequest($this->UserID, $this->EmailVerificationKey);
}
if ($this->ValidatedCredentials && $this->PostBackAction == 'ResetPassword') {
$this->PostBackValidated = $um->ResetPassword($this->UserID, $this->EmailVerificationKey, $this->NewPassword, $this->ConfirmPassword);
}
$this->CallDelegate('LoadData');
}
}
作者:evanfarra
项目:opensprints.or
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';
}
}
}
}
作者:evanfarra
项目:opensprints.or
function GetPropertiesFromForm(&$Context)
{
$this->CategoryID = ForceIncomingInt('CategoryID', 0);
$this->Name = ForceIncomingString('Name', '');
$this->Description = ForceIncomingString('Description', '');
$this->AllowedRoles = ForceIncomingArray('CategoryRoleBlock', array());
}
作者:avita
项目:vanilla-thew
function Check(&$Context)
{
// if (($this->UserID == 0 && !$Context->Configuration['PUBLIC_BROWSING']) || ($this->UserID > 0 && !$this->User->PERMISSION_SIGN_IN)) {
if ($this->UserID == 0 && $Context->SelfUrl == 'index.php' && ForceIncomingInt('CategoryID', 0) == 0 || $this->UserID > 0 && !$this->User->PERMISSION_SIGN_IN) {
if ($this->UserID > 0 && !$this->User->PERMISSION_SIGN_IN) {
$this->End($Context->Authenticator);
}
$Url = AppendUrlParameters($Context->Configuration['SAFE_REDIRECT'], 'ReturnUrl=' . urlencode(GetRequestUri()));
Redirect($Url);
}
}
作者:jara
项目:opencongres
function RegistrationForm(&$Context)
{
$this->Name = 'RegistrationForm';
$this->ValidActions = array('ProcessRegistrationChange', 'RegistrationChange');
$this->Constructor($Context);
if (!$this->Context->Session->User->Permission('PERMISSION_MANAGE_REGISTRATION')) {
$this->IsPostBack = 0;
} elseif ($this->IsPostBack) {
$this->Context->PageTitle = $this->Context->GetDefinition('RegistrationManagement');
$RoleID = ForceIncomingString('RoleID', '');
if ($RoleID == '') {
$RoleID = $this->Context->Configuration['DEFAULT_ROLE'];
}
$this->RoleManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'RoleManager');
$this->RoleSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
$this->RoleSelect->Name = 'RoleID';
// Add the applicant faux-role
$this->RoleSelect->AddOption(0, $this->Context->GetDefinition('Applicant'));
// Add all other roles
$this->RoleSelect->AddOptionsFromDataSet($this->Context->Database, $this->RoleManager->GetRoles(), 'RoleID', 'Name');
$this->RoleSelect->SelectedValue = $RoleID;
$this->RoleSelect->Attributes = ' id="ddRoleID"';
$ApprovedRoleID = ForceIncomingInt('ApprovedRoleID', $this->Context->Configuration['APPROVAL_ROLE']);
$this->ApprovedRoleSelect = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
$this->ApprovedRoleSelect->Name = 'ApprovedRoleID';
$this->ApprovedRoleSelect->AddOptionsFromDataSet($this->Context->Database, $this->RoleManager->GetRoles(), 'RoleID', 'Name');
$this->ApprovedRoleSelect->SelectedValue = $ApprovedRoleID;
$this->ApprovedRoleSelect->Attributes = ' id="ddApprovedRoleID"';
if ($this->PostBackAction == 'ProcessRegistrationChange' && $this->IsValidFormPostBack()) {
// Make the immediate access option default to '0' if the 'default' role
// for new members is '0' (applicant)
$AllowImmediateAccess = 0;
if ($RoleID > 0) {
$Role = $this->RoleManager->GetRoleById($RoleID);
$AllowImmediateAccess = $Role->PERMISSION_SIGN_IN ? '1' : '0';
}
$ConstantsFile = $this->Context->Configuration['APPLICATION_PATH'] . 'conf/settings.php';
$ConstantManager = $this->Context->ObjectFactory->NewContextObject($this->Context, 'ConfigurationManager');
// Set the constants to their new values
$ConstantManager->DefineSetting('DEFAULT_ROLE', $RoleID);
$ConstantManager->DefineSetting('ALLOW_IMMEDIATE_ACCESS', $AllowImmediateAccess);
$ConstantManager->DefineSetting('APPROVAL_ROLE', $ApprovedRoleID);
$this->DelegateParameters['ConstantManager'] =& $ConstantManager;
$this->CallDelegate('PreSaveSettings');
// Save the settings file
$ConstantManager->SaveSettingsToFile($ConstantsFile);
if ($this->Context->WarningCollector->Iif()) {
$this->PostBackValidated = 1;
}
}
}
$this->CallDelegate('Constructor');
}
作者:BackupTheBerlio
项目:milaninegw-sv
function PasswordResetForm(&$Context, $FormName = "")
{
$this->ValidActions = array("ResetPassword");
$this->FormName = $FormName;
$this->ValidatedCredentials = 0;
$this->Constructor($Context);
// Form properties
$this->UserID = ForceIncomingInt("u", 0);
$this->EmailVerificationKey = ForceIncomingString("k", "");
$this->NewPassword = ForceIncomingString("NewPassword", "");
$this->ConfirmPassword = ForceIncomingString("ConfirmPassword", "");
}
作者:avita
项目:vanilla-thew
function Render()
{
if ($this->IsPostBack) {
$this->CallDelegate('PreRender');
$this->PostBackParams->Clear();
if ($this->PostBackAction == 'Notifi') {
$this->PostBackParams->Set('PostBackAction', 'ProcessNotifi');
echo '<div id="Form" class="Account NotifiSettings">';
if (ForceIncomingInt('Success', 0)) {
echo '<div id="Success">' . $this->Context->GetDefinition('ChangesSaved') . '</div>';
}
echo '
<fieldset>
<legend>' . $this->Context->GetDefinition("NotifiSettings") . '</legend>
' . $this->Get_Warnings() . '
' . $this->Get_PostBackForm('frmNotifi') . '
<p>' . $this->Context->GetDefinition("NotifiAdminNotes") . '</p>
<ul>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_ALLOW_ALL', 1, $this->ConfigurationManager->GetSetting('NOTIFI_ALLOW_ALL'), '', $this->Context->GetDefinition('AdminAllowAll')) . '</span></p>
</li>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_ALLOW_CATEGORY', 1, $this->ConfigurationManager->GetSetting('NOTIFI_ALLOW_CATEGORY'), '', $this->Context->GetDefinition('AdminAllowCategories')) . '</span></p>
</li>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_ALLOW_DISCUSSION', 1, $this->ConfigurationManager->GetSetting('NOTIFI_ALLOW_DISCUSSION'), '', $this->Context->GetDefinition('AdminAllowDiscussions')) . '</span></p>
</li>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_ALLOW_BBCODE', 1, $this->ConfigurationManager->GetSetting('NOTIFI_ALLOW_BBCODE'), '', $this->Context->GetDefinition('AdminAllowBbcode')) . '</span></p>
</li>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_FORMAT_PLAINTEXT', 1, $this->ConfigurationManager->GetSetting('NOTIFI_FORMAT_PLAINTEXT'), '', $this->Context->GetDefinition('AdminFormatPlaintext')) . '</span></p>
</li>
<li>
<p><span>' . GetDynamicCheckBox('NOTIFI_AUTO_ALL', 1, $this->ConfigurationManager->GetSetting('NOTIFI_AUTO_ALL'), '', $this->Context->GetDefinition('AdminAutoAll')) . '</span></p>
</li>
</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>';
}
$this->CallDelegate('PostRender');
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
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);
}
作者:BackupTheBerlio
项目:milaninegw-sv
function DiscussionGrid(&$Context, $DiscussionManager, $CategoryID, $View)
{
$DiscussionStarterUserID = 0;
$BookmarkedDiscussionsOnly = 0;
$PrivateDiscussionsOnly = 0;
$this->Context =& $Context;
$this->CurrentPage = ForceIncomingInt("page", 1);
$this->View = $View;
// Get the category if filtered
$Category = false;
if ($CategoryID > 0) {
include_once sgLIBRARY . "Vanilla.Category.class.php";
$cm = $this->Context->ObjectFactory->NewContextObject($this->Context, "CategoryManager");
$Category = $cm->GetCategoryById($CategoryID);
}
$this->PageJump = "<a class=\"PageJump AllDiscussions\" href=\"./\">Show all discussions</a>";
switch ($View) {
case "Bookmarks":
$this->Context->PageTitle = $this->Context->GetDefinition("BookmarkedDiscussions");
$BookmarkedDiscussionsOnly = 1;
break;
case "YourDiscussions":
$this->Context->PageTitle = $this->Context->GetDefinition("YourDiscussions");
$DiscussionStarterUserID = $this->Context->Session->UserID;
break;
case "Private":
$this->Context->PageTitle = $this->Context->GetDefinition("PrivateDiscussions");
$PrivateDiscussionsOnly = 1;
break;
default:
if ($Category) {
$this->Context->PageTitle = $Category->Name . " " . $this->Context->GetDefinition("Discussions");
} else {
if ($this->Context->Session->User->BlocksCategories) {
$this->Context->PageTitle = $this->Context->GetDefinition("WatchedDiscussions");
} else {
$this->Context->PageTitle = $this->Context->GetDefinition("AllDiscussions");
}
$this->PageJump = "";
}
break;
}
$this->DiscussionData = $DiscussionManager->GetDiscussionList(agDISCUSSIONS_PER_PAGE, $this->CurrentPage, $CategoryID, $BookmarkedDiscussionsOnly, $PrivateDiscussionsOnly, $DiscussionStarterUserID);
$this->DiscussionDataCount = $DiscussionManager->GetDiscussionCount($CategoryID, $BookmarkedDiscussionsOnly, $PrivateDiscussionsOnly, $DiscussionStarterUserID);
}
作者:laiell
项目:lussumo-vanill
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");
}
作者:BackupTheBerlio
项目:milaninegw-sv
function CommentGrid(&$Context, $DiscussionManager, $DiscussionID)
{
$this->Context =& $Context;
$this->CurrentPage = ForceIncomingInt("page", 1);
// Load information about this discussion
$RecordDiscussionView = 1;
if ($this->Context->Session->UserID == 0) {
$RecordDiscussionView = 0;
}
$this->Discussion = $DiscussionManager->GetDiscussionById($DiscussionID, $RecordDiscussionView);
if ($this->Discussion) {
$this->Discussion->FormatPropertiesForDisplay();
if (!$this->Discussion->Active && !$this->Context->Session->User->AdminCategories) {
$this->Discussion = false;
$this->Context->WarningCollector->Add($this->Context->GetDefinition("ErrDiscussionNotFound"));
}
}
if ($this->Context->WarningCollector->Count() > 0) {
$this->CommentData = false;
$this->CommentDataCount = 0;
} else {
// Load the data
$CommentManager = $Context->ObjectFactory->NewContextObject($Context, "CommentManager");
$this->CommentData = $CommentManager->GetCommentList(agCOMMENTS_PER_PAGE, $this->CurrentPage, $DiscussionID);
$this->CommentDataCount = $CommentManager->GetCommentCount($DiscussionID);
}
// Set up the pagelist
$this->pl = $this->Context->ObjectFactory->NewContextObject($this->Context, "PageList");
$this->pl->NextText = $this->Context->GetDefinition("Next");
$this->pl->PreviousText = $this->Context->GetDefinition("Previous");
$this->pl->CssClass = "PageList";
$this->pl->TotalRecords = $this->CommentDataCount;
$this->pl->CurrentPage = $this->CurrentPage;
$this->pl->RecordsPerPage = agCOMMENTS_PER_PAGE;
$this->pl->PagesToDisplay = 10;
$this->pl->PageParameterName = "page";
$this->pl->DefineProperties();
$this->ShowForm = 0;
if ($this->Context->Session->UserID > 0 && ($this->pl->PageCount == 1 || $this->pl->PageCount == $this->CurrentPage) && (!$this->Discussion->Closed && $this->Discussion->Active || $this->Context->Session->User->AdminCategories)) {
$this->ShowForm = 1;
}
}
作者:evanfarra
项目:opensprints.or
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);
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function DefineProperties()
{
if (!$this->isPropertiesDefined) {
if ($this->CurrentPage == 0) {
$this->CurrentPage = ForceIncomingInt($this->PageParameterName, 1);
}
if ($this->Totalled) {
$this->PageCount = CalculateNumberOfPages($this->TotalRecords, $this->RecordsPerPage);
if ($this->CurrentPage > $this->PageCount) {
$this->CurrentPage = $this->PageCount;
}
if ($this->CurrentPage < 1) {
$this->CurrentPage = 1;
}
$this->FirstRecord = ($this->CurrentPage - 1) * $this->RecordsPerPage + 1;
$this->LastRecord = $this->FirstRecord + $this->RecordsPerPage - 1;
if ($this->LastRecord > $this->TotalRecords) {
$this->LastRecord = $this->TotalRecords;
}
} else {
if ($this->CurrentPage < 1) {
$this->CurrentPage = 1;
}
$this->PageCount = $this->CurrentPage;
if ($this->TotalRecords > $this->RecordsPerPage) {
$this->PageCount++;
}
$this->FirstRecord = ($this->CurrentPage - 1) * $this->RecordsPerPage + 1;
$this->LastRecord = $this->FirstRecord + $this->TotalRecords - 1;
if ($this->LastRecord < $this->FirstRecord) {
$this->LastRecord = $this->FirstRecord;
}
if ($this->PageCount > $this->CurrentPage) {
$this->LastRecord = $this->LastRecord - 1;
}
}
$this->isPropertiesDefined = 1;
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
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);
}
}
作者:laiell
项目:lussumo-vanill
function Render()
{
$this->CallDelegate('PreRender');
// Set up the pagelist
$CategoryID = ForceIncomingInt('CategoryID', 0);
if ($CategoryID == 0) {
$CategoryID = '';
}
$pl = $this->Context->ObjectFactory->NewContextObject($this->Context, 'PageList', 'CategoryID', $CategoryID);
$pl->NextText = $this->Context->GetDefinition('Next');
$pl->PreviousText = $this->Context->GetDefinition('Previous');
$pl->CssClass = 'PageList';
$pl->TotalRecords = $this->DiscussionDataCount;
$pl->CurrentPage = $this->CurrentPage;
$pl->RecordsPerPage = $this->Context->Configuration['DISCUSSIONS_PER_PAGE'];
$pl->PagesToDisplay = 10;
$pl->PageParameterName = 'page';
$pl->DefineProperties();
$PageDetails = $pl->GetPageDetails($this->Context);
$PageList = $pl->GetNumericList();
include ThemeFilePath($this->Context->Configuration, 'discussions.php');
$this->CallDelegate('PostRender');
}
作者:jara
项目:opencongres
function Render()
{
if ($this->IsPostBack) {
$this->CallDelegate('PreRender');
$this->PostBackParams->Clear();
$CategoryID = ForceIncomingInt('CategoryID', 0);
if ($this->PostBackAction == 'Category') {
$this->PostBackParams->Set('PostBackAction', 'ProcessCategory');
$this->CallDelegate('PreEditRender');
include ThemeFilePath($this->Context->Configuration, 'settings_category_edit.php');
$this->CallDelegate('PostEditRender');
} elseif ($this->PostBackAction == 'CategoryRemove') {
$this->PostBackParams->Set('PostBackAction', 'ProcessCategoryRemove');
$this->CategorySelect->Attributes = "onchange=\"document.location='" . GetUrl($this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=CategoryRemove') . "&CategoryID='+this.options[this.selectedIndex].value;\"";
$this->CategorySelect->SelectedValue = $CategoryID;
$this->CallDelegate('PreRemoveRender');
include ThemeFilePath($this->Context->Configuration, 'settings_category_remove.php');
$this->CallDelegate('PostRemoveRender');
} else {
$this->PostBackParams->Set('PostBackAction', 'ProcessCategories');
$this->CallDelegate('PreListRender');
include ThemeFilePath($this->Context->Configuration, 'settings_category_list.php');
$this->CallDelegate('PostListRender');
}
$this->CallDelegate('PostRender');
}
}
作者:jdegge
项目:pipwe
function RetrieveConfigurationPropertiesFromXml($Path)
{
$FauxContext = "0";
if ($this->ConfigFile == "") {
$this->ErrorManager->AddError($FauxContext, $this->Name, "RetrieveConfigurationPropertiesFromXml", "You must supply a path to the configuration file");
}
// Retrieve config file contents
$File = new File();
$File->Name = $this->ConfigFile;
$File->Path = $Path;
$FileManager = new FileManager();
$FileManager->ErrorManager =& $this->ErrorManager;
$File = $FileManager->Get($File);
// If there were errors retrieving the config file and we're in the CWD, report an error
if ($this->ErrorManager->ErrorCount > 0 && $Path == $this->CurrentWorkingDirectory) {
$this->ErrorManager->Clear();
$this->ErrorManager->AddError($FauxContext, $this->Name, "RetrieveConfigurationPropertiesFromXml", "The root configuration file could not be found/read (_config.xml).");
// If failed to retrieve the file from a non-root directory,
// just accept the root file
} elseif ($this->ErrorManager->ErrorCount > 0) {
$this->ErrorManager->Clear();
// If no errors occurred, continue to retrieve new configuration settings
} else {
// Create an XML Parser to retrieve configuration settings
$XMan = new XmlManager();
$XMan->ErrorManager =& $this->ErrorManager;
$MyConfig = $XMan->ParseNode($File->Body);
if ($MyConfig && $this->ErrorManager->ErrorCount == 0) {
$this->StyleUrl = $XMan->GetNodeValueByName($MyConfig, "StyleUrl");
$this->PageTitle = $XMan->GetNodeValueByName($MyConfig, "PageTitle");
$this->PageIntroduction = $XMan->GetNodeValueByName($MyConfig, "PageIntroduction");
$this->PageIntroduction = str_replace("[", "<", $this->PageIntroduction);
$this->PageIntroduction = str_replace("]", ">", $this->PageIntroduction);
$this->PageIntroduction = str_replace("\n", "<br />", $this->PageIntroduction);
$this->DisplayHiddenFiles = $XMan->GetNodeValueByName($MyConfig, "DisplayHiddenFiles");
$this->BrowseSubFolders = $XMan->GetNodeValueByName($MyConfig, "BrowseSubFolders");
$this->SortBy = $XMan->GetNodeValueByName($MyConfig, "SortBy");
$this->SortDirection = $XMan->GetNodeValueByName($MyConfig, "SortDirection");
$this->DateFormat = $XMan->GetNodeValueByName($MyConfig, "DateFormat");
$this->UsePageIntroductionInSubFolders = ForceBool($XMan->GetNodeValueByName($MyConfig, "UsePageIntroductionInSubFolders"), false);
$this->PluginHeight = ForceInt($XMan->GetNodeValueByName($MyConfig, "PluginHeight"), $this->PluginHeight);
$this->PluginWidth = ForceInt($XMan->GetNodeValueByName($MyConfig, "PluginWidth"), $this->PluginWidth);
$this->FilesPerPage = ForceIncomingInt("fpp", ForceInt($XMan->GetNodeValueByName($MyConfig, "FilesPerPage"), $this->FilesPerPage));
$this->MaxFilesPerPage = ForceInt($XMan->GetNodeValueByName($MyConfig, "MaxFilesPerPage"), $this->MaxFilesPerPage);
$this->FitImagesToPage = ForceBool($XMan->GetNodeValueByName($MyConfig, "FitImagesToPage"), $this->FitImagesToPage);
$this->UseThumbnails = ForceBool($XMan->GetNodeValueByName($MyConfig, "UseThumbnails"), $this->UseThumbnails);
$this->HideFiles = explode(",", $XMan->GetNodeValueByName($MyConfig, "HideFiles"));
for ($i = 0; $i < count($this->HideFiles); $i++) {
$this->FullyQualifiedHideFiles[] = $this->CurrentBrowsingDirectory . "/" . $this->HideFiles[$i];
}
}
}
return $this->ErrorManager->Iif();
}
作者:alucard26309
项目:K
<?php
// +---------------------------------------------+
// | Copyright 2010 - 2028 WeLive |
// | http://www.weentech.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
define('AJAX', true);
include 'includes/welive.Core.php';
$uid = ForceIncomingInt('uid');
$gid = ForceIncomingInt('gid');
$act = ForceIncomingString('act');
$ajax_last = ForceIncomingFloat('ajax_last');
if (!$uid or !$gid) {
die('Hacking!');
} elseif (ForceIncomingCookie('weliveG' . COOKIE_KEY) != md5($gid . WEBSITE_KEY . $uid . $_CFG['cKillRobotCode'])) {
setcookie('weliveG' . COOKIE_KEY, '', 0, '/');
die('Hacking!');
}
$mktime = explode(' ', microtime());
$realtime = $mktime[1];
$minitime = $mktime[0];
$lines = array();
//获取最新信息
$getmsgs = $DB->query("SELECT msg, biu, color FROM " . TABLE_PREFIX . "msg WHERE toid = '{$gid}' AND type = 1 AND fromid ='{$uid}' AND (created + minitime) > {$ajax_last} ORDER BY msgid ASC");
while ($msg = $DB->fetch($getmsgs)) {
$lines[] = WeLive(1, html($msg['msg']), 2, $msg['biu'], $msg['color']);
}
$sql = "SELECT u.userid, u.activated, u.isonline AS uisonline, g.guestid, g.isonline AS gisonline, g.isbanned FROM " . TABLE_PREFIX . "user u\r\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "guest g ON g.serverid = u.userid AND g.guestid = '{$gid}'\r\n\t\t\tWHERE u.userid = '{$uid}'\r\n\t\t\tAND u.usergroupid <> 1";
$uginfo = $DB->getOne($sql);
//验证客服和访客的状态
作者:jara
项目:opencongres
function GetDiscussionForm($Discussion)
{
$this->DelegateParameters['Discussion'] =& $Discussion;
$this->CallDelegate('DiscussionForm_PreRender');
if (!$this->DiscussionFormattedForDisplay) {
$Discussion->FormatPropertiesForDisplay();
}
$Discussion->Comment->FormatPropertiesForDisplay(1);
// Load the category selector
$cm = $this->Context->ObjectFactory->NewContextObject($this->Context, 'CategoryManager');
$CategoryData = $cm->GetCategories(0, 1);
$cs = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
$cs->Name = 'CategoryID';
$cs->CssClass = 'CategorySelect';
$cs->SelectedValue = ForceIncomingInt('CategoryID', $Discussion->CategoryID);
$cat = $this->Context->ObjectFactory->NewObject($this->Context, 'Category');
$LastBlocked = -1;
while ($Row = $this->Context->Database->GetRow($CategoryData)) {
$cat->Clear();
$cat->GetPropertiesFromDataSet($Row);
if ($cat->Blocked != $LastBlocked && $LastBlocked != -1) {
$cs->AddOption("-1", "---", " disabled=\"true\"");
}
$cs->AddOption($cat->CategoryID, $cat->Name);
$LastBlocked = $cat->Blocked;
}
$this->PostBackParams->Set('CommentID', $Discussion->FirstCommentID);
$this->PostBackParams->Set('AuthUserID', $Discussion->AuthUserID);
$this->PostBackParams->Set('UserDiscussionCount', $this->Context->Session->User->CountDiscussions);
$this->PostBackParams->Set('PostBackAction', 'SaveDiscussion');
include ThemeFilePath($this->Context->Configuration, 'discussion_form.php');
$this->CallDelegate('DiscussionForm_PostRender');
}
作者:jkzleon
项目:weliv
<?php
// +---------------------------------------------+
// | Copyright 2010 - 2028 WeLive |
// | http://www.weentech.com |
// | This file may not be redistributed. |
// +---------------------------------------------+
define('AUTH', true);
include 'includes/welive.Core.php';
include BASEPATH . 'includes/welive.Admin.php';
if ($userinfo['usergroupid'] != 1) {
exit;
}
$updates = Iif(ForceIncomingInt('check'), 1, 0);
PrintHeader($userinfo['username']);
echo '<div><ul>
<li>欢迎 <u>' . $userinfo['username'] . '</u> 进入管理面板! 为了确保系统安全, 请在关闭前点击 <a href="index.php?logout=1" onclick="return confirm(\'确定退出管理面板吗?\');">安全退出</a>!</li>
<li>隐私保护: <span class="note2">' . APP_NAME . '郑重承诺, 您在使用本系统时, ' . APP_NAME . '开发商不会收集您的任何信息</span>.</li>
<li>您在使用' . APP_NAME . '在线客服系统时有任何问题, 请访问: <a href="http://www.weentech.com/bbs/" target="_blank">闻泰网络</a>!</li>
</ul></div>
<BR>
<table border="0" cellpadding="0" cellspacing="0" class="normal" width="600">
<tr>
<td><b>程序名称</b></td>
<td><b>您现在的版本</b></td>
<td><b>最新版本</b></td>
</tr>
<tr>
<td><b>' . APP_NAME . '</b></td>
<td>' . APP_VERSION . '(UTF-8)免费版</td>
<td><span id="welive_latest_versioninfo"></span></td>