作者:evanfarra
项目:opensprints.or
function GetWhosOnline()
{
$s = $this->Context->ObjectFactory->NewContextObject($this->Context, "SqlBuilder");
$s->SetMainTable("User", "u");
$s->AddSelect(array("Name", "UserID", "DateLastActive", "Preferences"), "u");
$s->AddWhere("u", "DateLastActive", "", "DATE_SUB(NOW(), INTERVAL 5 MINUTE)", ">=", NULL, NULL, 0);
$result = $this->Context->Database->Select($s, $this->Name, "GetRecentUsers", "An error occurred while attempting to retrieve the requested information.");
if ($this->Context->Database->RowCount($result) == 0) {
return NULL;
} else {
$my_array = array();
while ($rows = $this->Context->Database->GetRow($result)) {
if ($rows["Preferences"]) {
$settings = unserialize($rows["Preferences"]);
if (array_key_exists("Phantom", $settings)) {
$phantom = ForceBool($settings["Phantom"], 0);
} else {
$phantom = false;
}
} else {
$phantom = false;
}
array_push($my_array, array("Name" => $rows["Name"], "UserID" => $rows["UserID"], "DateLastActive" => $rows["DateLastActive"], "Phantom" => $phantom));
}
return $my_array;
}
}
作者:evanfarra
项目:opensprints.or
function AddOptionsFromDataSet(&$Database, $DataSet, $IdField, $DisplayField, $CheckedField, $FlipCheckedValue, $Attributes = '')
{
$FlipCheckedValue = ForceBool($FlipCheckedValue, 0);
while ($rows = $Database->GetRow($DataSet)) {
$this->AddOption($rows[$IdField], $rows[$DisplayField], $rows[$CheckedField], $FlipCheckedValue, $Attributes);
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function DefineCollection($Collection, $ParameterPrefix = "", $IncludeByPrefix = "0", $ExcludeByPrefix = "0")
{
$ParameterPrefix = ForceString($ParameterPrefix, "");
$IncludeByPrefix = ForceBool($IncludeByPrefix, 0);
$ExcludeByPrefix = ForceBool($ExcludeByPrefix, 0);
$Add = 1;
while (list($key, $value) = each($Collection)) {
$Add = 1;
if ($ParameterPrefix != "") {
$PrefixMatchLocation = strstr($key, $ParameterPrefix);
// If the prefix isn't found or the location is anywhere other than 0 (the start of the variable name)
if ($PrefixMatchLocation === false || $PrefixMatchLocation != 0) {
if ($IncludeByPrefix) {
$Add = 0;
}
} else {
if ($ExcludeByPrefix) {
$Add = 0;
}
}
}
if ($Add) {
$this->Add($key, $value);
}
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function FormatPropertiesForDisplay($IncludeContents = "0")
{
$IncludeContents = ForceBool($IncludeContents, 0);
$this->Label = FormatStringForDisplay($this->Label);
if ($IncludeContents) {
$this->Contents = htmlspecialchars($this->Contents);
}
}
作者:evanfarra
项目:opensprints.or
function GetPropertiesFromDataSet($DataSet)
{
$this->CategoryID = ForceInt(@$DataSet['CategoryID'], 0);
$this->Name = ForceString(@$DataSet['Name'], '');
$this->Description = ForceString(@$DataSet['Description'], '');
$this->DiscussionCount = ForceInt(@$DataSet['DiscussionCount'], 0);
$this->Blocked = ForceBool(@$DataSet['Blocked'], 0);
$this->RoleBlocked = ForceBool(@$DataSet['RoleBlocked'], 0);
}
作者:evanfarra
项目:opensprints.or
function GetVariable($Name, $DataType = 'bool')
{
if ($DataType == 'int') {
return ForceInt(@$_SESSION[$Name], 0);
} elseif ($DataType == 'bool') {
return ForceBool(@$_SESSION[$Name], 0);
} else {
return ForceString(@$_SESSION[$Name], '');
}
}
作者:evanfarra
项目:opensprints.or
function GetPropertiesFromDataSet($DataSet, $ParseKeywords = '0')
{
$ParseKeywords = ForceBool($ParseKeywords, 0);
$this->SearchID = ForceInt(@$DataSet['SearchID'], 0);
$this->Label = ForceString(@$DataSet['Label'], '');
$this->Type = $this->DefineType(ForceString(@$DataSet['Type'], ''));
$this->Keywords = urldecode(ForceString(@$DataSet['Keywords'], ''));
if ($ParseKeywords) {
$this->ParseKeywords($this->Type, $this->Keywords);
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function GetPropertiesFromDataSet($DataSet, $ParseKeywords = "0")
{
$ParseKeywords = ForceBool($ParseKeywords, 0);
$this->SearchID = ForceInt(@$DataSet["SearchID"], 0);
$this->Label = ForceString(@$DataSet["Label"], "");
$this->Type = $this->DefineType(ForceString(@$DataSet["Type"], ""));
$this->Keywords = urldecode(ForceString(@$DataSet["Keywords"], ""));
if ($ParseKeywords) {
$this->ParseKeywords($this->Type, $this->Keywords);
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function GetVariable($Name, $DataType = "bool")
{
if ($DataType == "int") {
return ForceInt(@$_SESSION[$Name], 0);
} elseif ($DataType == "bool") {
return ForceBool(@$_SESSION[$Name], 0);
} elseif ($DataType == "Array") {
return ForceArray(@$_SESSION[$Name], array());
} else {
return ForceString(@$_SESSION[$Name], "");
}
}
作者:BackupTheBerlio
项目:milaninegw-sv
function GetPropertiesFromDataSet($DataSet)
{
$this->RoleID = ForceInt(@$DataSet["RoleID"], 0);
$this->Name = ForceString(@$DataSet["Name"], "");
$this->Icon = ForceString(@$DataSet["Icon"], "");
$this->Description = ForceString(@$DataSet["Description"], "");
$this->CanLogin = ForceBool(@$DataSet["CanLogin"], 0);
$this->CanPostDiscussion = ForceBool(@$DataSet["CanPostDiscussion"], 0);
$this->CanPostComment = ForceBool(@$DataSet["CanPostComment"], 0);
$this->CanPostHTML = ForceBool(@$DataSet["CanPostHTML"], 0);
$this->CanViewIps = ForceBool(@$DataSet["CanViewIps"], 0);
$this->AdminUsers = ForceBool(@$DataSet["AdminUsers"], 0);
$this->AdminCategories = ForceBool(@$DataSet["AdminCategories"], 0);
$this->MasterAdmin = ForceBool(@$DataSet["MasterAdmin"], 0);
$this->ShowAllWhispers = ForceBool(@$DataSet["ShowAllWhispers"], 0);
}
作者:laiell
项目:lussumo-vanill
function InsertItemAt(&$Collection, $Item, $Position, $ForcePosition = '0')
{
$ForcePosition = ForceBool($ForcePosition, 0);
if (array_key_exists($Position, $Collection)) {
if ($ForcePosition) {
// Move the item currently in that position ahead (forced ahead)
$this->InsertItemAt($Collection, $Collection[$Position], $Position + 1, 1);
// Place this item at the desired position
$Collection[$Position] = $Item;
} else {
$this->InsertItemAt($Collection, $Item, $Position + 1);
}
} else {
$Collection[$Position] = $Item;
}
}
作者:jara
项目:opencongres
function Authenticate($Username, $Password, $PersistentSession)
{
// Validate the username and password that have been set
$Username = FormatStringForDatabaseInput($Username);
$Password = FormatStringForDatabaseInput($Password);
$UserID = 0;
// Retrieve matching username/password values
$s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
$s->SetMainTable('User', 'u');
$s->AddJoin('Role', 'r', 'RoleID', 'u', 'RoleID', 'left join');
$s->AddSelect(array('UserID', 'VerificationKey'), 'u');
$s->AddSelect('PERMISSION_SIGN_IN', 'r');
$s->AddWhere('u', 'Name', '', $Username, '=');
$s->AddWhere('u', 'Password', '', $Password, '=', 'and', 'md5', 1, 1);
$s->AddWhere('u', 'Password', '', $Password, '=', 'or');
$s->EndWhereGroup();
$UserResult = $this->Context->Database->Select($s, 'Authenticator', 'Authenticate', 'An error occurred while attempting to validate your credentials');
if (!$UserResult) {
$UserID = -2;
} elseif ($this->Context->Database->RowCount($UserResult) > 0) {
$CanSignIn = 0;
$VerificationKey = '';
while ($rows = $this->Context->Database->GetRow($UserResult)) {
$VerificationKey = ForceString($rows['VerificationKey'], '');
if ($VerificationKey == '') {
$VerificationKey = DefineVerificationKey();
}
$UserID = ForceInt($rows['UserID'], 0);
$CanSignIn = ForceBool($rows['PERMISSION_SIGN_IN'], 0);
}
if (!$CanSignIn) {
$UserID = -1;
} else {
// Update the user's information
$this->UpdateLastVisit($UserID, $VerificationKey);
// Assign the session value
$this->AssignSessionUserID($UserID);
// Set the 'remember me' cookies
if ($PersistentSession) {
$this->SetCookieCredentials($UserID, $VerificationKey);
}
}
}
return $UserID;
}
作者:evanfarra
项目:opensprints.or
function GetCategoryBuilder($IncludeCount = '0', $ForceRoleBlock = '1')
{
$IncludeCount = ForceBool($IncludeCount, 0);
$s = $this->Context->ObjectFactory->NewContextObject($this->Context, 'SqlBuilder');
$s->SetMainTable('Category', 'c');
if ($IncludeCount) {
if ($this->Context->Session->User->Permission('PERMISSION_REMOVE_CATEGORIES') && $this->Context->Session->User->Preference('ShowDeletedDiscussions')) {
$s->AddJoin('Discussion', 'd', 'CategoryID', 'c', 'CategoryID', 'left join');
} else {
$s->AddJoin('Discussion', 'd', 'CategoryID', 'c', 'CategoryID', 'left join', " and d." . $this->Context->DatabaseColumns['Discussion']['Active'] . " = 1");
}
$s->AddSelect('DiscussionID', 'd', 'DiscussionCount', 'count');
}
$s->AddSelect(array('CategoryID', 'Name', 'Description'), 'c', '', '', '', 1);
$BlockCategoriesByRole = 1;
if ($this->Context->Session->User->Permission('PERMISSION_ADD_CATEGORIES') || $this->Context->Session->User->Permission('PERMISSION_EDIT_CATEGORIES') || $this->Context->Session->User->Permission('PERMISSION_REMOVE_CATEGORIES')) {
$BlockCategoriesByRole = 0;
}
if ($ForceRoleBlock) {
$BlockCategoriesByRole = 1;
}
if ($this->Context->Session->UserID > 0) {
$s->AddJoin('CategoryRoleBlock', 'crb', 'CategoryID', 'c', 'CategoryID', 'left join', ' and crb.' . $this->Context->DatabaseColumns['CategoryRoleBlock']['RoleID'] . ' = ' . $this->Context->Session->User->RoleID);
$s->AddJoin('CategoryBlock', 'b', 'CategoryID', 'c', 'CategoryID', 'left join', ' and b.' . $this->Context->DatabaseColumns['CategoryBlock']['UserID'] . ' = ' . $this->Context->Session->UserID);
$s->AddSelect('Blocked', 'b', 'Blocked', 'coalesce', '0');
} else {
$s->AddJoin('CategoryRoleBlock', 'crb', 'CategoryID', 'c', 'CategoryID', 'left join', ' and crb.' . $this->Context->DatabaseColumns['CategoryRoleBlock']['RoleID'] . ' = 1');
}
// Limit to categories that this user is allowed to see.
if ($BlockCategoriesByRole) {
$s->AddWhere('crb', 'Blocked', '', 0, '=', 'and', '', 1, 1);
$s->AddWhere('crb', 'Blocked', '', 0, '=', 'or', '', 0);
$s->AddWhere('crb', 'Blocked', '', 'null', 'is', 'or', '', 0);
$s->EndWhereGroup();
} else {
// Identify which of these categories is blocked by role
// (so administrators can easily see what they do and don't have access to)
$s->AddSelect('Blocked', 'crb', 'RoleBlocked', 'coalesce', '0');
}
$this->DelegateParameters['IncludeCount'] = $IncludeCount;
$this->DelegateParameters['ForceRoleBlock'] = $ForceRoleBlock;
$this->DelegateParameters['SqlBuilder'] =& $s;
$this->CallDelegate('PostGetCategoryBuilder');
return $s;
}
作者:avita
项目:vanilla-thew
function CommentLinks_AddLink(&$CommentGrid)
{
$Context =& $CommentGrid->Context;
$UnCounted =& $Context->PassThruVars['CommentLinks_UnCounted'];
$Page = ForceIncomingInt('page', 1) - 1;
$Comment =& $CommentGrid->DelegateParameters['Comment'];
$RowNumber =& $CommentGrid->DelegateParameters['RowNumber'];
// count the whispers & deleted comments on prior page(s), if any
if (1 == $RowNumber && 1 <= $Page && !$Comment->DiscussionWhisperUserID) {
$cm = $Context->ObjectFactory->NewContextObject($Context, 'CommentManager');
$DiscussionID = ForceIncomingString('DiscussionID', 0);
$PriorPages = $Page;
while (1 <= $PriorPages) {
$CommentData = $cm->GetCommentList($Context->Configuration['COMMENTS_PER_PAGE'], $PriorPages--, $DiscussionID);
while ($Row = $Context->Database->GetRow($CommentData)) {
if (ForceInt($Row['WhisperUserID'], 0) || ForceBool($Row['Deleted'], 0)) {
$UnCounted++;
}
}
}
}
if (!CommentLinks_WHISPERS && ($Comment->WhisperUserID || $Comment->DiscussionWhisperUserID)) {
$UnCounted++;
} else {
$Number = $RowNumber - $UnCounted + $Page * $Context->Configuration['COMMENTS_PER_PAGE'];
// Uncounted comments should not be numbered, but may still be linkable
if ($Comment->WhisperUserID || $Comment->DiscussionWhisperUserID || $Comment->Deleted) {
$UnCounted++;
$Number = $Comment->Deleted ? $Context->GetDefinition('CommentLinks_Deleted') : $Context->GetDefinition('CommentLinks_Whispered');
}
// This results in a shorter permalink URL that will persist if FriendlyURLs is later turned off.
$Url = $Context->Configuration['BASE_URL'] . '?CommentID=' . $Comment->CommentID;
$Link = '<a href="' . $Url . '" id="CommentID_' . $Comment->CommentID . '" rel="nofollow" Title="';
if (CommentLinks_CLIPBOARD) {
$Default = $Context->PassThruVars['CommentLinks_DefaultFormat'];
$Link .= str_replace('//1', $Default, $Context->GetDefinition('CommentLinks_DblClk')) . '" onclick="ShowMenu(' . $Comment->CommentID . ',\'' . $Number . '\');return false;" ondblclick="CopyDefault(' . $Comment->CommentID . ',\'' . $Number . '\');return false;';
} else {
$Link .= $Context->GetDefinition('CommentLinks_Permalink');
}
$CommentList =& $CommentGrid->DelegateParameters['CommentList'];
$CommentList .= $Link . '"># ' . $Number . '</a>';
}
}
作者:jara
项目:opencongres
function GetPropertiesFromDataSet($DataSet)
{
$this->RoleID = ForceInt(@$DataSet['RoleID'], 0);
$this->RoleName = ForceString(@$DataSet['Name'], '');
$this->Icon = ForceString(@$DataSet['Icon'], '');
$this->Description = ForceString(@$DataSet['Description'], '');
$this->PERMISSION_SIGN_IN = ForceBool(@$DataSet['PERMISSION_SIGN_IN'], 0);
$this->PERMISSION_HTML_ALLOWED = ForceBool(@$DataSet['PERMISSION_HTML_ALLOWED'], 0);
$this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION = ForceBool(@$DataSet['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'], 0);
$this->Unauthenticated = ForceBool(@$DataSet['Unauthenticated'], 0);
$TempPermissions = '';
$TempPermissions = ForceString(@$DataSet['Permissions'], '');
$TempPermissions = UnserializeAssociativeArray($TempPermissions);
$this->Permissions['PERMISSION_SIGN_IN'] = $this->PERMISSION_SIGN_IN;
$this->Permissions['PERMISSION_HTML_ALLOWED'] = $this->PERMISSION_HTML_ALLOWED;
$this->Permissions['PERMISSION_RECEIVE_APPLICATION_NOTIFICATION'] = $this->PERMISSION_RECEIVE_APPLICATION_NOTIFICATION;
while (list($TempKey, $TempValue) = each($TempPermissions)) {
$this->Permissions[$TempKey] = $TempValue;
}
unset($TempPermissions);
}
作者:unligh
项目:Cand
public function Visible($PageID)
{
$Page = $this->PageModel->GetID($PageID);
if ($this->Form->IsPostBack()) {
$Visible = ForceBool($Page->Visible, 0, 0, 1);
// Invert Visible property.
$this->PageModel->SetProperty($Page->PageID, 'Visible', $Visible);
$Page = $this->PageModel->GetID($PageID);
// Get just updated content.
if ($this->DeliveryType() == DELIVERY_TYPE_ALL) {
$Target = GetIncomingValue('Target', '/candy/page/browse');
Redirect($Target);
}
$this->SetData('Content', $Page);
$PageInfoModule = new PageInfoModule($this);
$this->JsonTarget('#PageInfoModule', $PageInfoModule->ToString(), 'Html');
} else {
$this->Form->SetData($Page);
}
$this->Render();
}
作者:evanfarra
项目:opensprints.or
function Authenticate($Username, $Password, $PersistentSession)
{
// Validate the username and password that have been set
$Username = FormatStringForDatabaseInput($Username);
$Password = FormatStringForDatabaseInput($Password);
$UserID = 0;
// Retrieve matching username/password values
$Query = "select u.UserID, r.PERMISSION_SIGN_IN\n\t\t\tfrom " . $this->Context->Configuration['DATABASE_TABLE_PREFIX'] . "User u\n\t\t\tinner join " . $this->Context->Configuration['DATABASE_TABLE_PREFIX'] . "Role r\n\t\t\t\ton u.RoleID = r.RoleID\n\t\t\twhere u.Name = '" . $Username . "'\n\t\t\t\tand u.Password = '" . $Password . "'";
$UserResult = $this->Context->Database->Execute($Query, 'Authenticator', 'Authenticate', 'An error occurred while attempting to validate your credentials');
if (!$UserResult) {
$UserID = -2;
} elseif ($this->Context->Database->RowCount($UserResult) > 0) {
$CanSignIn = 0;
$EncryptedUserID = '';
$VerificationKey = '';
while ($rows = $this->Context->Database->GetRow($UserResult)) {
$EncryptedUserID = md5($rows['UserID']);
$VerificationKey = DefineVerificationKey();
$UserID = ForceInt($rows['UserID'], 0);
$CanSignIn = ForceBool($rows['PERMISSION_SIGN_IN'], 0);
}
if (!$CanSignIn) {
$UserID = -1;
} else {
// Update the user's information
$this->UpdateLastVisit($UserID, $VerificationKey);
// Assign the session value
$this->AssignSessionUserID($UserID);
// Set the 'remember me' cookies
if ($PersistentSession) {
$this->SetCookieCredentials($EncryptedUserID, $VerificationKey);
}
}
}
return $UserID;
}
作者:TiG
项目:Garde
/**
* To be used for basic registration, and captcha registration
*/
public function InsertForBasic($FormPostValues)
{
$UserID = FALSE;
// Define the primary key in this model's table.
$this->DefineSchema();
// Add & apply any extra validation rules:
$this->Validation->ApplyRule('Email', 'Email');
// TODO: DO I NEED THIS?!
// Make sure that the checkbox val for email is saved as the appropriate enum
if (array_key_exists('ShowEmail', $FormPostValues)) {
$FormPostValues['ShowEmail'] = ForceBool($FormPostValues['ShowEmail'], '0', '1', '0');
}
$this->AddInsertFields($FormPostValues);
if ($this->Validate($FormPostValues, TRUE) === TRUE) {
$Fields = $this->Validation->ValidationFields();
// All fields on the form that need to be validated (including non-schema field rules defined above)
$Username = ArrayValue('Name', $Fields);
$Email = ArrayValue('Email', $Fields);
$Fields = $this->Validation->SchemaValidationFields();
// Only fields that are present in the schema
$Fields = RemoveKeyFromArray($Fields, $this->PrimaryKey);
$Fields['Password'] = array('md5' => $Fields['Password']);
// If in Captcha registration mode, check the captcha value
if (Gdn::Config('Garden.Registration.Method') == 'Captcha') {
$CaptchaPublicKey = ArrayValue('Garden.Registration.CaptchaPublicKey', $FormPostValues, '');
$CaptchaValid = ValidateCaptcha($CaptchaPublicKey);
if ($CaptchaValid !== TRUE) {
$this->Validation->AddValidationResult('Garden.Registration.CaptchaPublicKey', 'The reCAPTCHA value was not entered correctly. Please try again.');
return FALSE;
}
}
if (!$this->ValidateUniqueFields($Username, $Email)) {
return FALSE;
}
// Define the other required fields:
$Fields['Email'] = $Email;
// And insert the new user
$UserID = $this->_Insert($Fields);
AddActivity($UserID, 'Join', T('Welcome Aboard!'));
// Now update the role settings if necessary
$RoleIDs = Gdn::Config('Garden.Registration.DefaultRoles', array(8));
$this->SaveRoles($UserID, $RoleIDs, FALSE);
}
return $UserID;
}
作者:BackupTheBerlio
项目:milaninegw-sv
function AddWhere($Parameter1, $Parameter2, $ComparisonOperator, $AppendMethod = "and", $Function = "", $QuoteParameter2 = "1", $StartWhereGroup = "0")
{
$StartWhereGroup = ForceBool($StartWhereGroup, 0);
// Add the append method if there is an existing clause
if ($this->Wheres != "" && substr($this->Wheres, strlen($this->Wheres) - 1) != "(") {
$this->Wheres .= $AppendMethod . " ";
}
if ($StartWhereGroup) {
$this->Wheres .= "(";
}
if ($QuoteParameter2 == '1') {
$Parameter2 = "'" . $Parameter2 . "'";
}
if ($Function != "") {
$Parameter2 = $Function . "(" . $Parameter2 . ")";
}
// Do the comparison operation
$this->Wheres .= $Parameter1 . " " . $ComparisonOperator . " " . $Parameter2 . " ";
}
作者:kidma
项目:Garde
/**
* Searches through the /cache/controller_mappings.php file for the requested
* controller. If it doesn't find it, it searches through the entire
* application's folders for the requested controller. If it finds the
* controller, it adds the mapping to /cache/controller_mappings.php so it
* won't need to search again. If it doesn't find the controller file
* anywhere, it throws a fatal error.
*
* @param boolean $ThrowErrorOnFailure
* @todo $ThrowErrorOnFailure needs a description.
*/
private function _FetchController($ThrowErrorOnFailure = FALSE)
{
$ControllerWhiteList = $this->EnabledApplicationFolders();
// Don't include it if it's already been included
if (!class_exists($this->ControllerName())) {
$PathParts = array('controllers');
if ($this->_ControllerFolder != '') {
$PathParts[] = $this->_ControllerFolder;
}
$PathParts[] = strtolower($this->_ControllerName) . '.php';
$ControllerFileName = CombinePaths($PathParts);
// Force the mapping to search in the app folder if it was in the request
if ($this->_ApplicationFolder != '' && InArrayI($this->_ApplicationFolder, $ControllerWhiteList)) {
// Limit the white list to the specified application folder
$ControllerWhiteList = array($this->_ApplicationFolder);
}
$ControllerPath = Gdn_FileSystem::FindByMapping('controller_mappings.php', 'Controller', PATH_APPLICATIONS, $ControllerWhiteList, $ControllerFileName);
if ($ControllerPath !== FALSE) {
// Strip the "Application Folder" from the controller path (this is
// used by the controller for various purposes. ie. knowing which
// application to search in for a view file).
$this->_ApplicationFolder = explode(DS, str_replace(PATH_APPLICATIONS . DS, '', $ControllerPath));
$this->_ApplicationFolder = $this->_ApplicationFolder[0];
// Load the application's master controller
if (!class_exists($this->_ApplicationFolder . 'Controller')) {
include CombinePaths(array(PATH_APPLICATIONS, $this->_ApplicationFolder, 'controllers', 'appcontroller.php'));
}
// Now load the library (no need to check for existence - couldn't
// have made it here if it didn't exist).
include $ControllerPath;
}
}
if (!class_exists($this->ControllerName())) {
if ($ThrowErrorOnFailure === TRUE) {
if (ForceBool(Gdn::Config('Garden.Debug'))) {
trigger_error(ErrorMessage('Controller not found: ' . $this->ControllerName(), 'Dispatcher', '_FetchController'), E_USER_ERROR);
} else {
// Return a 404 message
list($this->_ApplicationFolder, $this->_ControllerName, $this->_ControllerMethod) = explode('/', $this->Routes['Default404']);
$ControllerFileName = CombinePaths(array('controllers', strtolower($this->_ControllerName) . '.php'));
$ControllerPath = Gdn_FileSystem::FindByMapping('controller_mappings.php', 'Controller', PATH_APPLICATIONS, $ControllerWhiteList, $ControllerFileName);
include CombinePaths(array(PATH_APPLICATIONS, $this->_ApplicationFolder, 'controllers', 'appcontroller.php'));
include $ControllerPath;
}
}
return FALSE;
} else {
return TRUE;
}
}