diff --git a/PHP/Manager/.htaccess b/PHP/Manager/.htaccess deleted file mode 100644 index c6dacc11..00000000 --- a/PHP/Manager/.htaccess +++ /dev/null @@ -1,10 +0,0 @@ -RewriteEngine On - -# Do not remove this line, otherwise mod_rewrite rules will stop working -RewriteBase / - -RewriteRule ^StyleSheets/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA] - -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA] diff --git a/PHP/Manager/Images/Logo.png b/PHP/Manager/Images/Logo.png deleted file mode 100644 index d0d8cabd..00000000 Binary files a/PHP/Manager/Images/Logo.png and /dev/null differ diff --git a/PHP/Manager/Images/Logo.xcf b/PHP/Manager/Images/Logo.xcf deleted file mode 100644 index e06b4be3..00000000 Binary files a/PHP/Manager/Images/Logo.xcf and /dev/null differ diff --git a/PHP/Manager/Include/MasterPages/000-WebPage.inc.php b/PHP/Manager/Include/MasterPages/000-WebPage.inc.php deleted file mode 100644 index 09c8d250..00000000 --- a/PHP/Manager/Include/MasterPages/000-WebPage.inc.php +++ /dev/null @@ -1,23 +0,0 @@ -StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/WebFramework/StyleSheets/Workday/Main.css"); - } - - protected function BeforeContent() - { - ?> -
">Log Out
- \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/000-Default/Main.inc.php b/PHP/Manager/Include/Modules/000-Default/Main.inc.php deleted file mode 100644 index 9c4773d2..00000000 --- a/PHP/Manager/Include/Modules/000-Default/Main.inc.php +++ /dev/null @@ -1,665 +0,0 @@ -query($query); - if ($result->num_rows < 1) return false; - return true; - } - - function CheckCredentials($admun, $admpw) - { - return ($admun == System::GetConfigurationValue("Administration.UserName") && $admpw == System::GetConfigurationValue("Administration.Password")); - } - function IsAdministrator() - { - if (!isset($_SESSION["admun"]) || !isset($_SESSION["admpw"])) return false; - - $admun = $_SESSION["admun"]; - $admpw = $_SESSION["admpw"]; - - return CheckCredentials($admun, $admpw); - } - - System::$BeforeLaunchEventHandler = function($path) - { - if (!IsConfigured() && (!($path[0] == "setup"))) - { - System::Redirect("~/setup"); - return true; - } - - if (!IsAdministrator() && (!($path[0] == "account" && $path[1] == "login.page")) && (!($path[0] == "setup")) && (!($path[0] == "favicon.ico"))) - { - $path1 = implode("/", $path); - $_SESSION["LoginRedirectURL"] = "~/" . $path1; - - System::Redirect("~/account/login.page"); - return true; - } - return true; - }; - - System::$Modules[] = new Module("net.Objectify.TenantManager.Default", array - ( - new ModulePage("", function($path) - { - $page = new WebPage(); - $page->BeginContent(); - - $btng = new ButtonGroup("btng1"); - $btng->Items[] = new ButtonGroupButton("btnDataCenters", "Data Centers", null, "~/Images/Buttons/DataCenters.png", "~/datacenter"); - $btng->Items[] = new ButtonGroupButton("btnDataTypes", "Data Types", null, "~/Images/Buttons/DataTypes.png", "~/datatype"); - $btng->Items[] = new ButtonGroupButton("btnTenantTypes", "Tenant Types", null, "~/Images/Buttons/TenantTypes.png", "~/tenanttype"); - $btng->Items[] = new ButtonGroupButton("btnTenants", "Tenants", null, "~/Images/Buttons/Tenants.png", "~/tenant"); - $btng->Items[] = new ButtonGroupButton("btnModules", "Modules", null, "~/Images/Buttons/Modules.png", "~/module"); - $btng->Render(); - - $page->EndContent(); - }), - new ModulePage("debug", function($path) - { - global $MySQL; - - $page = new WebPage(); - $page->BeginContent(); - if (is_numeric($path[0])) - { - if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "delete") - { - $query = "DELETE FROM " . System::GetConfigurationValue("Database.TablePrefix") . "DebugMessages WHERE message_ID = " . $path[0]; - $result = $MySQL->query($query); - System::Redirect("~/debug"); - } - else - { - $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessages WHERE message_ID = " . $path[0]; - $result = $MySQL->query($query); - $values = $result->fetch_assoc(); - - echo("

Error Details

"); - echo("

" . $values["message_Content"] . "

"); - - echo("

Parameters

"); - echo(""); - $query1 = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessageParameters WHERE mp_MessageID = " . $values["message_ID"]; - $result1 = $MySQL->query($query1); - $count1 = $result1->num_rows; - echo(""); - echo(""); - echo(""); - echo(""); - for ($j = 0; $j < $count1; $j++) - { - $values1 = $result1->fetch_assoc(); - echo(""); - echo(""); - echo(""); - echo(""); - } - echo("
NameValue
"); - echo($values1["mp_Name"]); - echo(""); - echo($values1["mp_Value"]); - echo("
"); - - echo("

Backtrace

"); - echo(""); - $query1 = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessageBacktraces WHERE bt_MessageID = " . $values["message_ID"]; - $result1 = $MySQL->query($query1); - $count1 = $result1->num_rows; - echo(""); - echo(""); - echo(""); - echo(""); - for ($j = 0; $j < $count1; $j++) - { - $values1 = $result1->fetch_assoc(); - echo(""); - echo(""); - echo(""); - echo(""); - } - echo("
File nameLine number
"); - echo($values1["bt_FileName"]); - echo(""); - echo($values1["bt_LineNumber"]); - echo("
"); - echo("
"); - echo("
"); - echo(""); - echo(""); - echo("Back to Messages"); - echo("
"); - echo("
"); - } - } - else - { - if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "delete") - { - $query = "DELETE FROM " . System::GetConfigurationValue("Database.TablePrefix") . "DebugMessages"; - $result = $MySQL->query($query); - System::Redirect("~/debug"); - } - else - { - echo("
"); - echo(""); - echo(""); - echo("
"); - - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - - $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "DebugMessages"; - $result = $MySQL->query($query); - $count = $result->num_rows; - for ($i = 0; $i < $count; $i++) - { - $values = $result->fetch_assoc(); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - echo(""); - } - echo("
TenantSeverityMessageTimestampIP Address
"); - $tenant = Tenant::GetByID($values["message_TenantID"]); - if ($tenant != null) - { - echo("URL . "/") . "\">" . $tenant->URL . ""); - } - echo(""); - switch ($values["message_SeverityID"]) - { - } - echo(""); - echo(""); - echo($values["message_Content"]); - echo(""); - echo(""); - echo($values["message_Timestamp"]); - echo(""); - echo($values["message_IPAddress"]); - echo("
"); - } - } - $page->EndContent(); - return true; - }), - new ModulePage("account", array - ( - new ModulePage("login.page", function($path) - { - $page = new LoginPage(); - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - if (isset($_POST["user_LoginID"]) && isset($_POST["user_Password"])) - { - $admun = $_POST["user_LoginID"]; - $admpw = $_POST["user_Password"]; - - if (CheckCredentials($admun, $admpw)) - { - $_SESSION["admun"] = $admun; - $_SESSION["admpw"] = $admpw; - - if (isset($_SESSION["LoginRedirectURL"])) - { - System::Redirect($_SESSION["LoginRedirectURL"]); - } - else - { - System::Redirect("~/"); - } - return true; - } - else - { - $page->InvalidCredentials = true; - } - } - } - $page->Render(); - return true; - }), - new ModulePage("logout.page", function($path) - { - $_SESSION["admun"] = null; - $_SESSION["admpw"] = null; - System::Redirect("~/"); - return true; - }) - )), - new ModulePage("tenant", array - ( - new ModulePage("", function($path) - { - $page = new MainPage(); - $page->Render(); - return true; - }), - new ModulePage("create", function($path) - { - if ($_SERVER["REQUEST_METHOD"] === "POST") - { - $tenant_URL = $_POST["tenant_URL"]; - $tenant_Description = $_POST["tenant_Description"]; - - $tenant_DataCenters = array(); - foreach ($_POST as $key => $value) - { - if (substr($key, 0, strlen("tenant_DataCenter_")) == "tenant_DataCenter_") - { - $id = substr($key, strlen("tenant_DataCenter_") + 1); - $tenant_DataCenters[] = DataCenter::GetByID($id); - } - } - - $tenant_Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled); - $tenant_Type = TenantType::GetByID($_POST["tenant_TypeID"]); - $tenant_PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]); - $tenant_BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]); - $tenant_EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]); - - $retval = Tenant::Create($tenant_URL, $tenant_Description, $tenant_Status, $tenant_Type, $tenant_PaymentPlan, $tenant_BeginTimestamp, $tenant_EndTimestamp, $tenant_DataCenters); - - if ($retval == null) - { - global $MySQL; - echo($MySQL->error . " (" . $MySQL->errno . ")"); - } - else - { - System::Redirect("~/tenant"); - } - } - else - { - $page = new TenantPropertiesPage(); - $page->Render(); - return true; - } - }), - new ModulePage("modify", function($path) - { - if ($_SERVER["REQUEST_METHOD"] === "POST") - { - $tenant_URL = $_POST["tenant_URL"]; - - $tenant = Tenant::GetByURL($path[0]); - - $tenant->URL = $_POST["tenant_URL"]; - $tenant->Description = $_POST["tenant_Description"]; - $tenant->Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled); - $tenant->Type = TenantType::GetByID($_POST["tenant_TypeID"]); - $tenant->PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]); - $tenant->BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]); - $tenant->EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]); - - $retval = $tenant->Update(); - - if (!$retval) - { - global $MySQL; - echo($MySQL->error . " (" . $MySQL->errno . ")"); - } - else - { - System::Redirect("~/tenant"); - } - return true; - } - else - { - $page = new TenantPropertiesPage(); - $page->Tenant = Tenant::GetByURL($path[0]); - $page->Render(); - return true; - } - }), - new ModulePage("clone", function($path) - { - if ($_SERVER["REQUEST_METHOD"] === "POST") - { - $tenant_URL = $_POST["tenant_URL"]; - $tenant_Description = $_POST["tenant_Description"]; - $tenant_Status = ($_POST["tenant_Status"] == 1 ? TenantStatus::Enabled : TenantStatus::Disabled); - $tenant_Type = TenantType::GetByID($_POST["tenant_TypeID"]); - $tenant_PaymentPlan = PaymentPlan::GetByID($_POST["tenant_PaymentPlanID"]); - $tenant_BeginTimestamp = ($_POST["tenant_BeginTimestampValid"] == "1" ? null : $_POST["tenant_BeginTimestamp"]); - $tenant_EndTimestamp = ($_POST["tenant_EndTimestampValid"] == "1" ? null : $_POST["tenant_EndTimestamp"]); - - $retval = Tenant::Create($tenant_URL, $tenant_Description, $tenant_Status, $tenant_Type, $tenant_PaymentPlan, $tenant_BeginTimestamp, $tenant_EndTimestamp); - - if ($retval == null) - { - global $MySQL; - echo($MySQL->error . " (" . $MySQL->errno . ")"); - } - else - { - System::Redirect("~/tenant"); - } - } - else - { - $page = new TenantPropertiesPage(); - $page->Tenant = Tenant::GetByURL($path[0]); - $page->Render(); - return true; - } - }), - new ModulePage("delete", function($path) - { - if ($_SERVER["REQUEST_METHOD"] === "POST") - { - if ($_POST["Confirm"] == "1") - { - $tenant = Tenant::GetByURL($path[0]); - if ($tenant->Delete()) - { - System::Redirect("~/tenant"); - } - else - { - global $MySQL; - echo($MySQL->error . " (" . $MySQL->errno . ")"); - } - } - } - else - { - $page = new ConfirmOperationPage(); - $page->ReturnButtonURL = "~/tenant"; - $page->Message = "Are you sure you want to delete the tenant '" . $path[0] . "'? This action cannot be undone, and will destroy any and all data associated with that tenant."; - $page->Render(); - return true; - } - }), - new ModulePage("manage", function($path) - { - if ($path[1] == "") - { - $tenant = Tenant::GetByURL($path[0]); - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $properties = $tenant->GetProperties(); - foreach ($properties as $property) - { - $tenant->SetPropertyValue($property, $_POST["Property_" . $property->ID]); - } - System::Redirect("~/tenant/manage/" . $path[0]); - return true; - } - else - { - $page = new TenantManagementPage(); - $page->Tenant = $tenant; - $page->Render(); - return true; - } - } - else - { - switch ($path[1]) - { - case "modules": - { - $page = new TenantModuleManagementPage(); - $page->Tenant = Tenant::GetByURL($path[0]); - $page->Module = \Objectify\Objects\Module::GetByID($path[2]); - $page->Render(); - break; - } - case "objects": - { - if ($path[2] == "") - { - // $page = new TenantObjectBrowsePage(); - // $page->CurrentTenant = Tenant::GetByURL($path[0]); - // $page->Render(); - } - else - { - switch ($path[3]) - { - case "instances": - { - switch ($path[4]) - { - case "": - { - $tenant = Tenant::GetByURL($path[0]); - $object = TenantObject::GetByID($path[2]); - - $page = new TenantObjectInstanceBrowsePage(); - $page->CurrentTenant = $tenant; - $page->CurrentObject = $object; - $page->Render(); - break; - } - } - } - case "methods": - { - switch ($path[4]) - { - case "static": - { - $tenant = Tenant::GetByURL($path[0]); - $object = TenantObject::GetByID($path[2]); - $method = TenantObjectMethod::GetByID($path[5]); - - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $method->CodeBlob = $_POST["method_CodeBlob"]; - $method->Update(); - - System::Redirect("~/tenant/manage/" . $tenant->URL . "/objects/" . $object->ID); - return true; - } - - $page = new TenantObjectMethodManagementPage(); - $page->CurrentTenant = $tenant; - $page->CurrentObject = $object; - $page->CurrentMethod = $method; - $page->Render(); - break; - } - case "instance": - { - $page = new TenantObjectMethodManagementPage(); - $page->CurrentTenant = Tenant::GetByURL($path[0]); - $page->CurrentObject = TenantObject::GetByID($path[2]); - $page->CurrentMethod = TenantObjectInstanceMethod::GetByID($path[5]); - $page->Render(); - break; - } - } - break; - } - case "": - { - $tenant = Tenant::GetByURL($path[0]); - $object = TenantObject::GetByID($path[2]); - - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $count = $_POST["InstanceProperty_NewPropertyCount"]; - for ($i = $count; $i > 0; $i--) - { - $name = $_POST["InstanceProperty_" . $i . "_Name"]; - $dataType = DataType::GetByID($_POST["InstanceProperty_" . $i . "_DataTypeID"]); - $defaultValue = $_POST["InstanceProperty_" . $i . "_DefaultValue"]; - - $object->CreateInstanceProperty(new TenantObjectInstanceProperty($name, $dataType, $defaultValue)); - } - - System::Redirect("~/tenant/manage/" . $tenant->URL . "/objects/" . $object->ID); - return true; - } - else - { - $page = new TenantObjectManagementPage(); - $page->CurrentTenant = $tenant; - $page->CurrentObject = $object; - $page->Render(); - } - break; - } - } - } - break; - } - } - } - return true; - }), - new ModulePage("launch", function($path) - { - $tenant = Tenant::GetByURL($path[0]); - header("Location: http://" . $tenant->DataCenters->Items[0]->HostName . "/" . $tenant->URL); - }) - )), - new ModulePage("module", array - ( - new ModulePage("", function($path) - { - $page = new ModuleMainPage(); - $page->Render(); - return true; - }), - new ModulePage("modify", function($path) - { - $module = \Objectify\Objects\Module::GetByID($path[0], true); - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $module->Title = $_POST["module_Title"]; - $module->Description = $_POST["module_Description"]; - $module->Update(); - - System::Redirect("~/module/modify/" . $path[0]); - } - else - { - $page = new ModuleManagementPage(); - $page->Module = $module; - $page->Render(); - } - return true; - }) - )), - new ModulePage("datacenter", array - ( - new ModulePage("", function($path) - { - $page = new DataCenterMainPage(); - $page->Render(); - return true; - }), - new ModulePage("create", function($path) - { - $datacenter = new DataCenter(); - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $datacenter->Title = $_POST["datacenter_Title"]; - $datacenter->Description = $_POST["datacenter_Description"]; - $datacenter->HostName = $_POST["datacenter_HostName"]; - $datacenter->Update(); - - System::Redirect("~/datacenter"); - } - else - { - $page = new DataCenterManagementPage(); - $page->DataCenter = null; - $page->Render(); - } - return true; - }), - new ModulePage("modify", function($path) - { - $datacenter = DataCenter::GetByID($path[0]); - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - $datacenter->Title = $_POST["datacenter_Title"]; - $datacenter->Description = $_POST["datacenter_Description"]; - $datacenter->HostName = $_POST["datacenter_HostName"]; - $datacenter->Update(); - - System::Redirect("~/datacenter/modify/" . $path[0]); - } - else - { - $page = new DataCenterManagementPage(); - $page->DataCenter = $datacenter; - $page->Render(); - } - return true; - }) - )) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/DefaultTenant.inc.php b/PHP/Manager/Include/Modules/001-Setup/DefaultTenant.inc.php deleted file mode 100644 index 7de4a4f7..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/DefaultTenant.inc.php +++ /dev/null @@ -1,41 +0,0 @@ -CreateProperty(new TenantProperty("ApplicationTitle", DataType::GetByName("Text"), "The title of your application. This is displayed in various areas around the site.", "My Application")); - $tenant->CreateProperty(new TenantProperty("ApplicationDescription", DataType::GetByName("Text"), "A short description of your application. This will appear in search results and other areas that use the HTML META description attribute.", "A versatile, modern, data-driven Web application powered by Objectify.")); - - // Install the resource bundles - $objResourceBundle = $tenant->GetObject("ResourceBundle"); - $instRBCommon = $objResourceBundle->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "Common") - )); - $instRBDefault = $objResourceBundle->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "Default") - )); - - $tenant->CreateProperty(new TenantProperty - ( - "ResourceBundles", DataType::GetByName("MultipleInstance"), "The resource bundles that are loaded with this tenant.", new MultipleInstanceProperty - ( - array($instRBDefault), - array($objResourceBundle) - ) - )); - -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Main.inc.php b/PHP/Manager/Include/Modules/001-Setup/Main.inc.php deleted file mode 100644 index 9703f790..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Main.inc.php +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - -" . $FileName); - if ($f === false) return false; - - fwrite($f, " $value) - { - $skip = false; - foreach ($preinstalledKeys as $pikey) - { - if ($key == $pikey) - { - $skip = true; - break; - } - } - if ($skip) continue; - fwrite($f, "\tSystem::\$Configuration[\"" . $key . "\"] = " . VariableToString($value) . ";\n"); - } - fwrite($f, "?>\n"); - fclose($f); - return true; - } - ?> -
- " style="height: 200px;" /> -
-

- is configuring your initial instance. This would be a good time for a coffee break... -

- -Items[0]->Code . ": " . DataFX::$Errors->Items[0]->Message); - Message(DataFX::$Errors->Items[0]->Query); - return true; - } - - // create the Users table - /* - $tables = array - ( - new Table("MarketResourceBankDetails", "bankdetail_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ResourceTypeID", "INT", null, null, false), - new Column("Name", "VARCHAR", 50, null, false), - new Column("TitleSingular", "VARCHAR", 100, null, false), - new Column("TitlePlural", "VARCHAR", 100, null, false) - )), - new Table("Tasks", "task_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("TenantID", "INT", null, null, false), - new Column("Title", "VARCHAR", 100, null, false), - new Column("URL", "LONGTEXT", null, null, false) - )), - new Table("Themes", "theme_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("TenantID", "INT", null, null, false), - new Column("Name", "VARCHAR", 100, null, false), - new Column("Title", "VARCHAR", 100, null, false), - new Column("CreationUserID", "INT", null, null, false), - new Column("CreationTimestamp", "DATETIME", null, null, false) - )), - new Table("UserEquippedItems", "equippeditem_", array - ( - new Column("UserID", "INT", null, null, false), - new Column("ItemID", "INT", null, null, false) - )), - new Table("UserInventoryFolders", "inventoryitem_", array - ( - new Column("ID", "INT", null, null, false), - new Column("Title", "VARCHAR", 100, null, false), - new Column("ParentFolderID", "INT", null, null, true) - )), - new Table("UserInventoryItems", "inventoryitem_", array - ( - new Column("UserID", "INT", null, null, false), - new Column("ItemID", "INT", null, null, false), - new Column("ParentFolderID", "INT", null, null, true) - )), - new Table("UserProfileContents", "content_", array - ( - // posts by the user on their profile. can be scrolled back and forth like a journal. supports HTML! - new Column("ID", "INT", null, null, false, true, true), - new Column("TenantID", "INT", null, null, false), - new Column("CreationUserID", "INT", null, null, false), - new Column("CreationTimestamp", "DATETIME", null, null, false), - new Column("Content", "LONGTEXT", null, null, false) - )), - new Table("UserProfileContentFeedbacks", "feedback_", array - ( - // likes and dislikes for user profile contents - new Column("ContentID", "INT", null, null, false), - new Column("FeedbackTypeID", "INT", null, null, false), - new Column("Comments", "VARCHAR", 200, null, false), - new Column("CreationUserID", "INT", null, null, false), - new Column("CreationTimestamp", "DATETIME", null, null, false) - )) - ); - */ - - $tables = array(); - - $tablefilepath = dirname(__FILE__) . "/Tables/*.inc.php"; - $tablefiles = glob($tablefilepath); - foreach ($tablefiles as $tablefile) - { - require($tablefile); - } - - foreach ($tables as $table) - { - if ($table->Exists()) - { - Message("Table '" . $table->Name . "' already exists, skipping creation"); - } - else - { - $retval = $table->Create(); - if ($retval) - { - Success("Created table '" . $table->Name . "'"); - } - else - { - Failure("Could not create table '" . $table->Name . "'"); - Message("Database returned error " . DataFX::$Errors->Items[0]->Code . ": " . DataFX::$Errors->Items[0]->Message); - Message(DataFX::$Errors->Items[0]->Query); - } - } - } - - $tenant = Tenant::Create($_POST["Application_DefaultTenant"], "The default tenant for " . System::$Configuration["Application.Name"] . "."); - $tablefilepath = dirname(__FILE__) . "/TenantObjects/*.inc.php"; - $tablefiles = glob($tablefilepath); - foreach ($tablefiles as $tablefile) - { - require($tablefile); - } - - require(dirname(__FILE__) . "/DefaultTenant.inc.php"); -?> -
- BeginContent(); -?> -
- " style="height: 200px;" /> -
-

- Please provide some information about your server to create the initial tenant. Other - tenants may be created and removed at any time by entering the Administrator Control Panel. -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
" /> -
" />
" />
" style="width: 100%;" />

-
-EndContent(); - return true; - }, - function($path) - { - $enabled = false; - if (isset(System::$Configuration["Setup.Enabled"])) - { - $enabled = (System::$Configuration["Setup.Enabled"] == "true"); - } - if (!$enabled) - { - $page = new \WebFX\WebPage(); - $page->Title = "Configuration Error"; - $page->BeginContent(); - echo("
This Objectify installation has not been configured. Please contact the server administrator.
"); - $page->EndContent(); - return false; - } - }) - )); -?> diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/000-DataTypes.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/000-DataTypes.inc.php deleted file mode 100644 index 5ed59ae0..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/000-DataTypes.inc.php +++ /dev/null @@ -1,324 +0,0 @@ -" . $input . ""); -EOD -), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' - echo(""); -EOD -) - )), - new Record(array - ( - new RecordColumn("Name", "CodeBlob"), - new RecordColumn("Description", "Allows you to enter script code with a special text editor."), - new RecordColumn("EncoderCodeBlob", null), - new RecordColumn("DecoderCodeBlob", null), - new RecordColumn("ColumnRendererCodeBlob", <<<'EOD' - echo("
" . $input . "
"); -EOD -), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' - echo(""); -EOD -) - )), - new Record(array - ( - new RecordColumn("Name", "Number"), - new RecordColumn("Description", "Stores numeric data."), - new RecordColumn("EncoderCodeBlob", null), - new RecordColumn("DecoderCodeBlob", null), - new RecordColumn("ColumnRendererCodeBlob", null), - new RecordColumn("EditorRendererCodeBlob", null) - )), - new Record(array - ( - new RecordColumn("Name", "Boolean"), - new RecordColumn("Description", "Stores a true/false or yes/no value."), - new RecordColumn("EncoderCodeBlob", null), - new RecordColumn("DecoderCodeBlob", null), - new RecordColumn("ColumnRendererCodeBlob", <<<'EOD' -echo(""); -EOD -), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' -echo(""); -EOD -) - )), - new Record(array - ( - new RecordColumn("Name", "Measurement"), - new RecordColumn("Description", "Stores measurement data, which is a double-precision floating-point number followed by a unit of measurement."), - new RecordColumn("EncoderCodeBlob", null), - new RecordColumn("DecoderCodeBlob", null), - new RecordColumn("ColumnRendererCodeBlob", null), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' -echo(" "); -EOD -) - )), - new Record(array - ( - new RecordColumn("Name", "DateTime"), - new RecordColumn("Description", "Stores a date and time value."), - new RecordColumn("EncoderCodeBlob", null), - new RecordColumn("DecoderCodeBlob", null), - new RecordColumn("ColumnRendererCodeBlob", null), - new RecordColumn("EditorRendererCodeBlob", null) - )), - new Record(array - ( - new RecordColumn("Name", "SingleInstance"), - new RecordColumn("Description", "Represents a property that returns a single TenantObjectInstance object."), - new RecordColumn("EncoderCodeBlob", <<<'EOD' -// $input should be a TenantObjectInstance -if ($input == null) -{ - $bt = debug_backtrace(); - trigger_error("SingleInstance::Encoder - input is null, did you mean to pass in a blank SingleInstanceProperty?, in " . $bt["file"] . "::" . $bt["function"] . " on line " . $bt["line"] . "; ", E_USER_WARNING); - return ""; -} -// encode the property by simply storing the instance ID in the property value. -$output = ""; -$count = count($input->ValidObjects); -for ($i = 0; $i < $count; $i++) -{ - $output .= $input->ValidObjects[$i]->ID; - if ($i < $count - 1) $output .= ","; -} -$output .= ":"; -if ($input != null) -{ - if ($input->GetInstance() != null) $output .= $input->GetInstance()->ID; -} -return $output; -EOD -), - new RecordColumn("DecoderCodeBlob", <<<'EOD' -// $input should be a String in the format t0,t1,t2:i0,i1,i2,i3... where tx is an ID of a TenantObject that is valid in the property and ix is an ID of a TenantObjectInstance -// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value. -$dcb = explode(":", $input); -$validObjects = explode(",", $dcb[0]); -$instance = $dcb[1]; -$output = new SingleInstanceProperty(); - -// loop through all the valid objects and add them to the MultipleInstanceProperty -$count = count($validObjects); -for ($i = 0; $i < $count; $i++) -{ - $output->ValidObjects[] = TenantObject::GetByID($validObjects[$i]); -} - -// assign the instance -$output->Instance = TenantObjectInstance::GetByID($instance); -return $output; -EOD -), - new RecordColumn("ColumnRendererCodeBlob", <<<'EOD' -$inst = $input->Instance; -echo("
"); - echo(""); - echo("
"); -if ($inst != null) -{ - echo ("" . $inst->ToString() . ""); -} - echo("
"); -echo("
"); -EOD -), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' -$inst = $input->Instance; -echo("
"); -$insts_text = $inst->ID; - echo(""); - echo(""); - echo("
"); -if ($inst != null) -{ - echo ("" . $inst->ToString() . ""); -} - echo("
"); - echo(""); -echo("
"); -EOD -) - )), - new Record(array - ( - new RecordColumn("Name", "MultipleInstance"), - new RecordColumn("Description", "Represents a property that returns an array of TenantObjectInstance objects."), - new RecordColumn("EncoderCodeBlob", <<<'EOD' -// $input should be an array of TenantObjectInstance objects -// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value. the list of valid -// object types is stored in the first part of the property, separated by a colon. -if ($input == null) -{ - PhoenixSNS::Log("MultipleInstance::Encoder input is null - did you mean to pass in a blank MultipleInstanceProperty?"); - return ""; -} - -$output = ""; -$count = count($input->ValidObjects); -for ($i = 0; $i < $count; $i++) -{ - $output .= $input->ValidObjects[$i]->ID; - if ($i < $count - 1) $output .= ","; -} -$output .= ":"; -$insts = $input->GetInstances(); -$i = 0; -$count = count($insts); -foreach ($insts as $inst) -{ - $output .= $inst->ID; - if ($i < $count - 1) $output .= ","; - $i++; -} -return $output; -EOD -), - new RecordColumn("DecoderCodeBlob", <<<'EOD' -// $input should be a String in the format t0,t1,t2:i0,i1,i2,i3... where tx is an ID of a TenantObject that is valid in the property and ix is an ID of a TenantObjectInstance -// encode the property by simply storing the instance ID of each instance, separated by commas, in the property value. -if ($input == "") -{ - $bt = debug_backtrace(); - trigger_error("MultipleInstance::Decoder - input is null, did you mean to pass in a blank MultipleInstanceProperty?, in " . $bt["file"] . "::" . $bt["function"] . " on line " . $bt["line"] . "; ", E_USER_WARNING); - return null; -} - -$dcb = explode(":", $input); -$validObjects = explode(",", $dcb[0]); -$instances = explode(",", $dcb[1]); -$output = new MultipleInstanceProperty(); - -// loop through all the valid objects and add them to the MultipleInstanceProperty -$count = count($validObjects); -for ($i = 0; $i < $count; $i++) -{ - $output->ValidObjects[] = TenantObject::GetByID($validObjects[$i]); -} - -// loop through all of the instances and add them to the MultipleInstanceProperty -$count = count($instances); -for ($i = 0; $i < $count; $i++) -{ - $output->AddInstance(TenantObjectInstance::GetByID($instances[$i])); -} -return $output; -EOD -), - new RecordColumn("ColumnRendererCodeBlob", <<<'EOD' -if ($input == null) return; -if (!is_object($input) || (get_class($input) != "PhoenixSNS\\Objects\\MultipleInstanceProperty")) -{ - $bt = debug_backtrace(); - trigger_error("Expected MultipleInstanceProperty, got something else in " . $bt[1]["file"] . "::" . $bt[1]["function"] . " at line " . $bt[1]["line"], E_USER_WARNING); - return; -} -$insts = $input->GetInstances(); -echo("
"); - echo(""); - echo(""); - echo("
"); -foreach ($insts as $inst) -{ - if ($inst != null) - { - echo ("" . $inst->ToString() . ""); - } -} - echo("
"); -echo("
"); -EOD -), - new RecordColumn("EditorRendererCodeBlob", <<<'EOD' -if ($input == null) return; -if (!is_object($input) || (get_class($input) != "PhoenixSNS\\Objects\\MultipleInstanceProperty")) -{ - $bt = debug_backtrace(); - trigger_error("Expected MultipleInstanceProperty, got something else in " . $bt[1]["file"] . "::" . $bt[1]["function"] . " at line " . $bt[1]["line"], E_USER_WARNING); - return; -} -$insts = $input->GetInstances(); -echo("
"); -$insts_text = ""; -$count = count($insts); -for ($i = 0; $i < $count; $i++) -{ - $inst = $insts[$i]; - $insts_text .= $inst->ID; - if ($i < $count - 1) $insts_text .= ", "; -} - echo(""); - echo(""); - echo("
"); -foreach ($insts as $inst) -{ - if ($inst != null) - { - echo ("" . $inst->ToString() . ""); - } -} - echo("
"); - echo(""); -echo("
"); -EOD -) - )) - )); - $tables[] = $tblDataTypes; -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/000-Languages.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/000-Languages.inc.php deleted file mode 100644 index 04067797..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/000-Languages.inc.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/000-Modules.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/000-Modules.inc.php deleted file mode 100644 index a0f4edc6..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/000-Modules.inc.php +++ /dev/null @@ -1,168 +0,0 @@ -ForeignKeys = array - ( - new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))) - ); - $tables[] = $tblModuleMenuItems; - - $tblModuleObjects = new Table("ModuleObjects", "object_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ModuleID", "INT", null, null, true), - new Column("ParentObjectID", "INT", null, null, true), - new Column("Title", "VARCHAR", 256, null, true), - new Column("Description", "LONGTEXT", null, null, true) - ), - array - ( - new Record(array - ( - new RecordColumn("ModuleID", 7), - new RecordColumn("Title", "Game") - )) - )); - $tblModuleObjects->ForeignKeys = array - ( - new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))), - new TableForeignKey("ParentObjectID", new TableForeignKeyColumn($tblModuleObjects, $tblModuleObjects->GetColumnByName("ID"))) - ); - $tables[] = $tblModuleObjects; - - $tblModulePages = new Table("ModulePages", "modulepage_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ModuleID", "INT", null, null, true), - new Column("ParentPageID", "INT", null, null, true), - new Column("URL", "VARCHAR", 1024, null, true), - new Column("Content", "LONGTEXT", null, null, true) - ), - array - ( - new Record(array - ( - new RecordColumn("ModuleID", 1), - new RecordColumn("URL", "groups") - )), - new Record(array - ( - new RecordColumn("ModuleID", 1), - new RecordColumn("URL", "pages") - )), - new Record(array - ( - new RecordColumn("ModuleID", 1), - new RecordColumn("URL", "forums") - )) - )); - $tblModulePages->ForeignKeys = array - ( - new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))), - new TableForeignKey("ParentPageID", new TableForeignKeyColumn($tblModulePages, $tblModulePages->GetColumnByName("ID"))) - ); - $tables[] = $tblModulePages; -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/001-Tenants.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/001-Tenants.inc.php deleted file mode 100644 index 42797d3d..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/001-Tenants.inc.php +++ /dev/null @@ -1,78 +0,0 @@ -UniqueKeys = array - ( - new TableKey(array - ( - new TableKeyColumn("URL") - )) - ); - $tables[] = $tblTenants; - - $tblTenantProperties = new Table("TenantProperties", "property_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("TenantID", "INT", null, null, true), - new Column("Name", "VARCHAR", 256, null, false), - new Column("Description", "LONGTEXT", null, null, true), - new Column("DataTypeID", "INT", null, null, false), - new Column("DefaultValue", "LONGBLOB", null, null, true) - )); - $tblTenantProperties->ForeignKeys = array - ( - new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, "ID")), - new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID")) - ); - $tables[] = $tblTenantProperties; - - $tblTenantPropertyValues = new Table("TenantPropertyValues", "propval_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("PropertyID", "INT", null, null, false, true, true), - new Column("Value", "LONGTEXT", null, null, true) - )); - $tblTenantPropertyValues->ForeignKeys = array - ( - new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantProperties, "ID")) - ); - $tables[] = $tblTenantPropertyValues; - - $tblTenantModules = new Table("TenantModules", "tenantmodule_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("TenantID", "INT", null, null, false), - new Column("ModuleID", "INT", null, null, false) - )); - $tblTenantModules->ForeignKeys = array - ( - new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, "ID")) - ); - $tables[] = $tblTenantModules; -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/002-TenantObjects.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/002-TenantObjects.inc.php deleted file mode 100644 index 481e6ae2..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/002-TenantObjects.inc.php +++ /dev/null @@ -1,197 +0,0 @@ -ForeignKeys = array - ( - new TableForeignKey("TenantID", new TableForeignKeyColumn($tblTenants, $tblTenants->GetColumnByName("ID"))), - new TableForeignKey("ModuleID", new TableForeignKeyColumn($tblModules, $tblModules->GetColumnByName("ID"))), - new TableForeignKey("ParentObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID"))) - ); - $tables[] = $tblTenantObjects; - - $tblTenantObjectTitles = new Table("TenantObjectTitles", "entry_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("LanguageID", "INT", null, null, false), - new Column("Value", "LONGTEXT", null, null, false) - )); - $tblTenantObjectTitles->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID"))), - new TableForeignKey("LanguageID", new TableForeignKeyColumn($tblLanguages, $tblLanguages->GetColumnByName("ID"))) - ); - $tables[] = $tblTenantObjectTitles; - - $tblTenantObjectDescriptions = new Table("TenantObjectDescriptions", "entry_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("LanguageID", "INT", null, null, false), - new Column("Value", "LONGTEXT", null, null, false) - )); - $tblTenantObjectDescriptions->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, $tblTenantObjects->GetColumnByName("ID"))), - new TableForeignKey("LanguageID", new TableForeignKeyColumn($tblLanguages, $tblLanguages->GetColumnByName("ID"))) - ); - $tables[] = $tblTenantObjectDescriptions; - - // Available static properties for the objects. - $tblTenantObjectProperties = new Table("TenantObjectProperties", "property_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("Name", "VARCHAR", 256, null, true), - new Column("DataTypeID", "INT", null, null, true), - new Column("DefaultValue", "LONGBLOB", null, null, true), - new Column("IsRequired", "INT", null, 0, false), - new Column("EnumerationID", "INT", null, null, true), - new Column("RequireChoiceFromEnumeration", "INT", null, 0, false), - new Column("ColumnVisible", "INT", null, 0, false) - )); - $tblTenantObjectProperties->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")), - new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID")) - ); - $tables[] = $tblTenantObjectProperties; - - // Values for static properties of objects. - $tblTenantObjectPropertyValues = new Table("TenantObjectPropertyValues", "propval_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("PropertyID", "INT", null, null, false), - new Column("Value", "LONGBLOB", null, null, true) - )); - $tblTenantObjectPropertyValues->ForeignKeys = array - ( - new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantObjectProperties, "ID")) - ); - $tables[] = $tblTenantObjectPropertyValues; - - // Instances of the objects. - $tblTenantObjectInstances = new Table("TenantObjectInstances", "instance_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false) - )); - $tblTenantObjectInstances->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")) - ); - $tables[] = $tblTenantObjectInstances; - - // Properties of the object instances. - $tblTenantObjectInstanceProperties = new Table("TenantObjectInstanceProperties", "property_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("Name", "VARCHAR", 256, null, true), - new Column("DataTypeID", "INT", null, null, true), - new Column("DefaultValue", "LONGBLOB", null, null, true), - new Column("IsRequired", "INT", null, 0, false), - new Column("EnumerationID", "INT", null, null, true), - new Column("RequireChoiceFromEnumeration", "INT", null, 0, false), - new Column("ColumnVisible", "INT", null, 0, false) - )); - $tblTenantObjectInstanceProperties->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")), - new TableForeignKey("DataTypeID", new TableForeignKeyColumn($tblDataTypes, "ID")) - ); - $tables[] = $tblTenantObjectInstanceProperties; - - // Values of the object instance properties. - $tblTenantObjectInstancePropertyValues = new Table("TenantObjectInstancePropertyValues", "propval_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("InstanceID", "INT", null, null, false), - new Column("PropertyID", "INT", null, null, false), - new Column("Value", "LONGBLOB", null, null, false) - )); - $tblTenantObjectInstancePropertyValues->PrimaryKey = new TableKey(array - ( - new TableKeyColumn("InstanceID"), - new TableKeyColumn("PropertyID") - )); - $tblTenantObjectInstancePropertyValues->ForeignKeys = array - ( - new TableForeignKey("InstanceID", new TableForeignKeyColumn($tblTenantObjectInstances, "ID")), - new TableForeignKey("PropertyID", new TableForeignKeyColumn($tblTenantObjectInstanceProperties, "ID")) - ); - $tables[] = $tblTenantObjectInstancePropertyValues; - - // Object static methods. - $tblTenantObjectMethods = new Table("TenantObjectMethods", "method_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("Name", "VARCHAR", 256, null, false), - new Column("CodeBlob", "LONGBLOB", null, null, false) - )); - $tblTenantObjectMethods->ForeignKeys = array - ( - new TableForeignKey("ObjectID", new TableForeignKeyColumn($tblTenantObjects, "ID")) - ); - $tables[] = $tblTenantObjectMethods; - - // Object static method namespace references. - $tblTenantObjectMethodNamespaceReferences = new Table("TenantObjectMethodNamespaceReferences", "ns_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("MethodID", "INT", null, null, false), - new Column("Value", "VARCHAR", 256, null, false) - )); - $tblTenantObjectMethodNamespaceReferences->ForeignKeys = array - ( - new TableForeignKey("MethodID", new TableForeignKeyColumn($tblTenantObjectMethods, "ID")) - ); - $tables[] = $tblTenantObjectMethodNamespaceReferences; - - // Object instance methods. - $tblTenantObjectInstanceMethods = new Table("TenantObjectInstanceMethods", "method_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("ObjectID", "INT", null, null, false), - new Column("Name", "VARCHAR", 256, null, false), - new Column("CodeBlob", "LONGBLOB", null, null, false) - )); - $tables[] = $tblTenantObjectInstanceMethods; - - // Object static method namespace references. - $tblTenantObjectInstanceMethodNamespaceReferences = new Table("TenantObjectInstanceMethodNamespaceReferences", "ns_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("MethodID", "INT", null, null, false), - new Column("Value", "VARCHAR", 256, null, false) - )); - $tables[] = $tblTenantObjectInstanceMethodNamespaceReferences; -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/DataCenters.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/DataCenters.inc.php deleted file mode 100644 index 1dad40b0..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/DataCenters.inc.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/DebugMessages.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/DebugMessages.inc.php deleted file mode 100644 index 0e633ae6..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/DebugMessages.inc.php +++ /dev/null @@ -1,51 +0,0 @@ -ForeignKeys = array - ( - new TableForeignKey("MessageID", new TableForeignKeyColumn($tblDebugMessages, "ID"), TableForeignKeyReferenceOption::Cascade) - ); - $tables[] = $tblDebugMessageBacktraces; - - $tblDebugMessageParameters = new Table("DebugMessageParameters", "mp_", array - ( - // $name, $dataType, $size, $value, $allowNull, $primaryKey, $autoIncrement - new Column("ID", "INT", null, null, false, true, true), - new Column("MessageID", "INT", null, null, false), - new Column("Name", "LONGTEXT", null, null, false), - new Column("Value", "LONGTEXT", null, null, true) - )); - $tblDebugMessageParameters->ForeignKeys = array - ( - new TableForeignKey("MessageID", new TableForeignKeyColumn($tblDebugMessages, "ID"), TableForeignKeyReferenceOption::Cascade) - ); - $tables[] = $tblDebugMessageParameters; -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/Languages.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/Languages.inc.php deleted file mode 100644 index 9f30e6f8..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/Languages.inc.php +++ /dev/null @@ -1,213 +0,0 @@ -Introduce yourself!") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "invitegroup"), - new RecordColumn("StringValue", "Invite this user to join a group") - )), - - // === account/settings - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "personal"), - new RecordColumn("StringValue", "Personal Information") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "realname_label"), - new RecordColumn("StringValue", "What's your real name?") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "realname_example"), - new RecordColumn("StringValue", "Johnny Test") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "birthdate_label"), - new RecordColumn("StringValue", "When were you born?") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "birthdate_example"), - new RecordColumn("StringValue", "1994-03-25") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "email_label"), - new RecordColumn("StringValue", "What's your e-mail address?") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "email_example"), - new RecordColumn("StringValue", "somebody@phoenixsns.net") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "appearance"), - new RecordColumn("StringValue", "Appearance and Personalization") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "longname_label"), - new RecordColumn("StringValue", "What do you want to be called?") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "longname_example"), - new RecordColumn("StringValue", "Phenix the Great") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "startpage_label"), - new RecordColumn("StringValue", "When I log in, take me to:") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "shortname_label"), - new RecordColumn("StringValue", "Your site URL name:") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "shortname_example"), - new RecordColumn("StringValue", "phenix") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "language_label"), - new RecordColumn("StringValue", "Default language:") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "security"), - new RecordColumn("StringValue", "Security and Authentication") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "profile_visibility_label"), - new RecordColumn("StringValue", "Who can see my profile?") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "deactivate_account"), - new RecordColumn("StringValue", "Deactivate Account") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "use_with_caution"), - new RecordColumn("StringValue", "Please exercise great care when considering this option. Once done, it cannot be un-done.") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "deactivate_account_warning"), - new RecordColumn("StringValue", "Would you like to deactivate your account and lose all your items, resources, conversation history, friends, group memberships, and other site features? If so, click the link.") - )), - new Record(array - ( - new RecordColumn("LanguageID", 1), - new RecordColumn("StringName", "deactivate_account_button"), - new RecordColumn("StringValue", "Yes, please deactivate my account now.") - )) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/PaymentPlans.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/PaymentPlans.inc.php deleted file mode 100644 index 2f7e356f..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/PaymentPlans.inc.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/SecurityPermissions.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/SecurityPermissions.inc.php deleted file mode 100644 index 9cba3022..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/SecurityPermissions.inc.php +++ /dev/null @@ -1,126 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/TenantDataCenters.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/TenantDataCenters.inc.php deleted file mode 100644 index 9a920dea..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/TenantDataCenters.inc.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/TenantTypes.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/TenantTypes.inc.php deleted file mode 100644 index edb96f4c..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/TenantTypes.inc.php +++ /dev/null @@ -1,29 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/Tables/Users.inc.php b/PHP/Manager/Include/Modules/001-Setup/Tables/Users.inc.php deleted file mode 100644 index 683c06e5..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/Tables/Users.inc.php +++ /dev/null @@ -1,17 +0,0 @@ - \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-Script.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-Script.inc.php deleted file mode 100644 index e6c9607a..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-Script.inc.php +++ /dev/null @@ -1,125 +0,0 @@ -CreateObject("ScriptLanguage", - array - ( - new TenantStringTableEntry($langEnglish, "Script Language") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A programming language used to write scripts.") - ), - array - ( - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text")) - )); - - $objClientScriptLanguage = $tenant->CreateObject("ClientScriptLanguage", - array - ( - new TenantStringTableEntry($langEnglish, "Client Script Language") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A programming language used to write scripts to be run on the client.") - ), - array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text")) - ), $objScriptLanguage, - array - ( - array - ( - new TenantObjectInstancePropertyValue("Name", "JavaScript"), - new TenantObjectInstancePropertyValue("ContentType", "text/javascript") - ), - array - ( - new TenantObjectInstancePropertyValue("Name", "VBScript"), - new TenantObjectInstancePropertyValue("ContentType", "text/vbscript") - ) - )); - $objServerScriptLanguage = $tenant->CreateObject("ServerScriptLanguage", - array - ( - new TenantStringTableEntry($langEnglish, "Server Script Language") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A programming language used to write scripts to be run on the server.") - ), - array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("ContentType", DataType::GetByName("Text")) - ), $objScriptLanguage, array - ( - array - ( - new TenantObjectInstancePropertyValue("Name", "PHP"), - new TenantObjectInstancePropertyValue("ContentType", "application/x-php") - ) - )); - - $objScript = $tenant->CreateObject("Script", - array - ( - new TenantStringTableEntry($langEnglish, "Script") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A code blob that can be used in various scriptable areas.") - ), - array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objScriptLanguage))), - new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob")) - )); - - $objClientScript = $tenant->CreateObject("ClientScript", - array - ( - new TenantStringTableEntry($langEnglish, "Client Script") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A code blob that can be used in various scriptable areas on the client.") - ), - array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objClientScriptLanguage))), - new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob")) - ), $objScript); - - $objServerScript = $tenant->CreateObject("ServerScript", "A code blob that can be used in various scriptable areas on the server.", array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Description", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("Language", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(null, array($objServerScriptLanguage))), - new TenantObjectInstanceProperty("Content", DataType::GetByName("CodeBlob")) - ), $objScript); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-User.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-User.inc.php deleted file mode 100644 index e36b6847..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/000-User.inc.php +++ /dev/null @@ -1,155 +0,0 @@ -CreateEnumeration("UserProfileVisibility", "Specifies the possible values for the ProfileVisibility property on the User object.", - array - ( - new TenantEnumerationChoice("Everyone", "Your profile is visible to everyone inside and outside the site."), - new TenantEnumerationChoice("Sitewide", "Your profile is visible only to other registered users."), - new TenantEnumerationChoice("FriendsExtended", "Your profile is visible to your friends and friends of your friends."), - new TenantEnumerationChoice("Friends", "Your profile is visible only to you and your friends."), - new TenantEnumerationChoice("Private", "Your profile is visible only to you.") - )); - - $enumUserPresenceStatus = $tenant->CreateEnumeration("UserPresenceStatus", "Specifies the possible values for the ProfileVisibility property on the User object.", - array - ( - new TenantEnumerationChoice("Offline", "You are not online."), - new TenantEnumerationChoice("Available", "You are available for other people to chat with."), - new TenantEnumerationChoice("Away", "You are away from your computer at the moment."), - new TenantEnumerationChoice("ExtendedAway", "You are going to be away for an extended period of time."), - new TenantEnumerationChoice("Busy", "You are busy and do not want to be bothered."), - new TenantEnumerationChoice("Hidden", "Your presence status is hidden.") - )); - - $object = $tenant->CreateObject("User", "Contains information about a Objectify user account.", array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("LoginID"), - new TenantObjectInstanceProperty("URL"), - new TenantObjectInstanceProperty("DisplayName"), - new TenantObjectInstanceProperty("EmailAddress"), - new TenantObjectInstanceProperty("EmailConfirmationCode"), - new TenantObjectInstanceProperty("BirthDate"), - new TenantObjectInstanceProperty("RealName"), - new TenantObjectInstanceProperty("PasswordHash"), - new TenantObjectInstanceProperty("PasswordSalt"), - new TenantObjectInstanceProperty("Theme"), - new TenantObjectInstanceProperty("Language"), - new TenantObjectInstanceProperty("ProfileVisibility", null, null, true, $enumUserProfileVisibility, true), - new TenantObjectInstanceProperty("ConsecutiveLoginCount"), - new TenantObjectInstanceProperty("ConsecutiveLoginFailures"), - new TenantObjectInstanceProperty("LastLoginTimestamp"), - new TenantObjectInstanceProperty("PresenceStatus", null, null, true, $enumUserPresenceStatus, true), - new TenantObjectInstanceProperty("PresenceMessage"), - new TenantObjectInstanceProperty("RegistrationTimestamp"), - new TenantObjectInstanceProperty("RegistrationIPAddress"), - new TenantObjectInstanceProperty("StartPage") - )); - - $object->CreateMethod("SaltPassword", array(), - - // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! -<<<'EOD' -return \UUID::Generate(); -EOD -, "Generates a Objectify password salt using a Universally Unique Identifier (UUID)."); - - $object->CreateMethod("HashPassword", array - ( - new TenantObjectMethodParameter("input") - ), - - // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! -<<<'EOD' -return hash("sha512", $input); -EOD -, "Generates a Objectify password hash using the SHA-512 algorithm."); - - $object->CreateMethod("ValidateCredentials", array - ( - new TenantObjectMethodParameter("username"), - new TenantObjectMethodParameter("password") - ), - - // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! -<<<'EOD' -$tenant = Tenant::GetCurrent(); -$inst = $thisObject->GetInstance(array -( - new TenantQueryParameter("LoginID", $username) -)); - -// if there is no user with this LoginID, return null -if ($inst == null) return null; - -// get the password salt used in the creation of this instance -$salt = $inst->GetPropertyValue($thisObject->GetInstanceProperty("PasswordSalt")); - -// generate the salted password hash by concatenating the salt and the password -$pwhash = hash("sha512", $salt . $password); - -// try to get an instance with the specified login ID and password hash -$user = $thisObject->GetInstance(array -( - new TenantQueryParameter("LoginID", $username), - new TenantQueryParameter("PasswordHash", $pwhash) -)); - -return $user; -EOD -, "Validates the given user name and password against the database and returns an instance of the User if the validation is successful.", array -( - 'Objectify\Objects\Tenant', - 'Objectify\Objects\TenantObjectMethodParameterValue', - 'Objectify\Objects\TenantQueryParameter' -)); - - $object->CreateMethod("GetCurrentUser", array(), - - // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! -<<<'EOD' -$tenant = Tenant::GetCurrent(); -if (!((isset($_SESSION["CurrentUserName[" . $tenant->ID . "]"])) && (isset($_SESSION["CurrentPassword[" . $tenant->ID . "]"])))) -{ - return null; -} - -$username = $_SESSION["CurrentUserName[" . $tenant->ID . "]"]; -$password = $_SESSION["CurrentPassword[" . $tenant->ID . "]"]; - -$inst = $thisObject->GetInstance(array -( - new TenantQueryParameter("LoginID", $username) -)); - -// if there is no user with this LoginID, return null -if ($inst == null) return null; - -// get the password salt used in the creation of this instance -$salt = $inst->GetPropertyValue($thisObject->GetInstanceProperty("PasswordSalt")); - -// generate the salted password hash by concatenating the salt and the password -$pwhash = hash("sha512", $salt . $password); - -// try to get an instance with the specified login ID and password hash -$user = $thisObject->GetInstance(array -( - new TenantQueryParameter("LoginID", $username), - new TenantQueryParameter("PasswordHash", $pwhash) -)); - -return $user; -EOD -, "Gets the user that is currently logged into Objectify.", array -( - // using statements go here - 'Objectify\Objects\Tenant', - 'Objectify\Objects\TenantQueryParameter' -)); - -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/001-ResourceBundle.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/001-ResourceBundle.inc.php deleted file mode 100644 index 9f7c6dfa..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/001-ResourceBundle.inc.php +++ /dev/null @@ -1,35 +0,0 @@ -CreateObject("ResourceObject", "Represents a single resource object (StyleSheet, Script, etc.) that is loaded in a ResourceBundle on the Objectify tenant.", array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")) - )); - - $objStyleSheet = $tenant->CreateObject("StyleSheet", "Represents a style sheet resource object, containing a set of rules that determine how particular elements appear in a page.", array - ( - ), $objResourceObject); - - $objScriptResourceObject = $tenant->CreateObject("ScriptResourceObject", "Represents a script resource object, containing a single pointer to a ClientScript (executable code that can be run on the client).", array - ( - new TenantObjectInstanceProperty("ClientScript", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(array(), array($objClientScript))) - ), $objResourceObject); - - $object = $tenant->CreateObject("ResourceBundle", "Contains a bundle of resources (StyleSheets, Scripts, etc.) that are loaded in with the Objectify tenant.", array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")), - new TenantObjectInstanceProperty("ResourceObjects", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objResourceObject))) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/002-Page.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/002-Page.inc.php deleted file mode 100644 index c12265a9..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/002-Page.inc.php +++ /dev/null @@ -1,231 +0,0 @@ -CreateObject("UserAgent", "A User Agent that can determine what browser or client the guest is using to access the Web site.", array - ( - new TenantObjectInstanceProperty("Name"), - new TenantObjectInstanceProperty("Value") - )); - $objUserAgentBehavior = $tenant->CreateObject("UserAgentBehavior", "The behavior to use when determining whether a list of user agents is allowed (whitelist) or denied (blacklist).", array - ( - new TenantObjectInstanceProperty("Name") - )); - - $propUserAgents = new TenantObjectInstanceProperty("UserAgents", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objUserAgent))); - $propUserAgents->Description = "If one or more UserAgents are specified in this property, depending on the UserAgentBehavior this PageSection will display ONLY on these UserAgents."; - - $propUserAgentBehavior = new TenantObjectInstanceProperty("UserAgentBehavior", DataType::GetByName("SingleInstance"), new SingleInstanceProperty(array(), array($objUserAgentBehavior))); - - $objPageSection = $tenant->CreateObject("PageSection", "Represents a section of a Page on the tenant. Sections can be assigned to one or more Pages, and can be duplicated within the same Page.", array - ( - new TenantObjectInstanceProperty("Name"), - new TenantObjectInstanceProperty("Content"), - $propUserAgents, - $propUserAgentBehavior - )); - - $object = $tenant->CreateObject("Page", "Represents an individual Page on the tenant. Pages have URLs (such as ~/dashboard or ~/account/login) and host one or more PageSections.", array - ( - // property name, data type, default value, value required?, enumeration, require choice from enumeration? - new TenantObjectInstanceProperty("Name"), - new TenantObjectInstanceProperty("URL"), - new TenantObjectInstanceProperty("Sections", DataType::GetByName("MultipleInstance"), new MultipleInstanceProperty(array(), array($objPageSection))) - )); - - $instSectGuestMainPageDashboardPanel = $objPageSection->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "GuestMainPageDashboardPanel"), - new TenantObjectInstancePropertyValue("Content", <<<'EOD' -GetObject("GuestMainPageDashboardPost"); - $posts = $objDashboardPost->GetInstances(); - - if (count($posts) == 0) - { -?> -
-
There's nothing here!
-
- If you are the site administrator, please make sure you have configured your Objectify installation correctly. Log - in to your Administrator Control Panel to set up your installation and add content. -
-
- - -EOD -) - )); - - $instSectGuestMainPageRegisterPanel = $objPageSection->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "GuestMainPageRegisterPanel"), - new TenantObjectInstancePropertyValue("Content", <<<'EOD' - -
-
" method="POST" style="width: 100%;"> -
Don't have an account yet?
-
-

Sign up for free right now!

-
- -
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-EOD -) - )); - - $instSectGuestMainPageLoginPanel = $objPageSection->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "GuestMainPageLoginPanel"), - new TenantObjectInstancePropertyValue("Content", <<<'EOD' - -
" method="POST" style="width: 100%;"> -
-
Already have an account?
-
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- Log In -
-
-
-EOD -) - )); - - $instGuestMainPage = $object->CreateInstance(array - ( - new TenantObjectInstancePropertyValue("Name", "GuestMainPage"), - new TenantObjectInstancePropertyValue("Sections", new MultipleInstanceProperty - ( - array - ( - $instSectGuestMainPageDashboardPanel, - $instSectGuestMainPageLoginPanel, - $instSectGuestMainPageRegisterPanel - ), - array($objPageSection) - )) - )); - - $object->CreateInstanceMethod("GetSections", array(), - - // code goes here... you cannot "use" namespaces here; please put them in NamespaceReferences!!! -<<<'EOD' - $thisTenant = Tenant::GetCurrent(); - $objPageSection = $thisTenant->GetObject("PageSection"); - $insts = $objPageSection->GetInstances(array - ( - new TenantQueryParameter("Page", $thisInstance) - )); -EOD -, "Gets all of the PageSections associated with the current Page.", array( - "Tenant", - "TenantQueryParameter" -)); - -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-DataFormat.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-DataFormat.inc.php deleted file mode 100644 index 7b2dbb6f..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-DataFormat.inc.php +++ /dev/null @@ -1,28 +0,0 @@ -CreateObject("DataFormat", - array - ( - new TenantStringTableEntry($langEnglish, "Data Format") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A format used to serialize and deserialize documents.") - ), - array - ( - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-ObjectModel.inc.php b/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-ObjectModel.inc.php deleted file mode 100644 index f0afefa9..00000000 --- a/PHP/Manager/Include/Modules/001-Setup/TenantObjects/003-ObjectModel.inc.php +++ /dev/null @@ -1,28 +0,0 @@ -CreateObject("ObjectModel", - array - ( - new TenantStringTableEntry($langEnglish, "Object Model") - ), - array - ( - new TenantStringTableEntry($langEnglish, "A model that provides the in-memory, DataFormat-agnostic representation of document data.") - ), - array - ( - new TenantObjectInstanceProperty("Name", DataType::GetByName("Text")) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/000-LoginPage.inc.php b/PHP/Manager/Include/Pages/000-LoginPage.inc.php deleted file mode 100644 index 3cbe562c..00000000 --- a/PHP/Manager/Include/Pages/000-LoginPage.inc.php +++ /dev/null @@ -1,48 +0,0 @@ - -

Authentication Required

-

You must log in to view this page.

-
- - - - - - - - - - - - - - - -
- InvalidCredentials) - { - ?>Incorrect user name/password combination. -
- -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/000-MainPage.inc.php b/PHP/Manager/Include/Pages/000-MainPage.inc.php deleted file mode 100644 index 6cd5e46b..00000000 --- a/PHP/Manager/Include/Pages/000-MainPage.inc.php +++ /dev/null @@ -1,116 +0,0 @@ - -

Tenant Management

-

There are tenants in total.

- -
- ">Create New Tenant -
- IsExpired()) - { - $countExpired++; - } - else - { - $countActive++; - } - } - ?> -

Active Tenants ()

- - - - - - - - - - - - IsExpired()) continue; - ?> - - - - - - - - - - - -
Tenant NameTenant TypeData CentersPayment PlanActivation DateTermination DateDescriptionActions
URL)); ?>" target="_blank">URL); ?>Type->Title); ?>DataCenters->Items as $item) - { - echo("HostName . "/" . $tenant->URL . "\">" . $item->Title . " (" . $item->HostName . ")
"); - } - ?>
PaymentPlan->Title); ?>BeginTimestamp == null ? "(indefinite)" : $tenant->BeginTimestamp); ?>EndTimestamp == null ? "(indefinite)" : $tenant->EndTimestamp); ?>Description); ?> - URL)); ?>">Manage | - URL)); ?>">Edit | - URL)); ?>">Clone | - URL)); ?>">Delete -
-

Inactive Tenants ()

- - - - - - - - - - - - IsExpired()) continue; - ?> - - - - - - - - - - - -
Tenant NameTenant TypeData CentersPayment PlanActivation DateTermination DateDescriptionActions
URL)); ?>" target="_blank">URL); ?>Type->Title); ?>DataCenter->Title); ?>PaymentPlan->Title); ?>BeginTimestamp == null ? "(indefinite)" : $tenant->BeginTimestamp); ?>EndTimestamp == null ? "(indefinite)" : $tenant->EndTimestamp); ?>Description); ?> - URL)); ?>">Manage | - URL)); ?>">Edit | - URL)); ?>">Clone | - URL)); ?>">Delete -
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/001-TenantPropertiesPage.inc.php b/PHP/Manager/Include/Pages/001-TenantPropertiesPage.inc.php deleted file mode 100644 index cfb2f2d2..00000000 --- a/PHP/Manager/Include/Pages/001-TenantPropertiesPage.inc.php +++ /dev/null @@ -1,104 +0,0 @@ -Tenant != null) - { - $this->Title = "Edit Tenant Configuration: " . $this->Tenant->URL; - } - else - { - $this->Title = "Create New Tenant"; - } - } - - protected function RenderContent() - { - ?> -

Edit Tenant Configuration

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
Tenant != null && $this->Tenant->DataCenters->Contains($datacenter)) { echo(" checked=\"checked\""); } ?> name="tenant_DataCenter_ID); ?>" id="txtTenantDataCenter_ID); ?>" /> - -
- -
-
- - ">Cancel -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/002-ConfirmOperationPage.inc.php b/PHP/Manager/Include/Pages/002-ConfirmOperationPage.inc.php deleted file mode 100644 index 37ee1263..00000000 --- a/PHP/Manager/Include/Pages/002-ConfirmOperationPage.inc.php +++ /dev/null @@ -1,39 +0,0 @@ -ReturnButtonURL = "~/"; - } - - protected function RenderContent() - { - ?> -

Confirm Operation

-

Message); ?>

-
- - - Cancel -
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/003-TenantManagementPage.inc.php b/PHP/Manager/Include/Pages/003-TenantManagementPage.inc.php deleted file mode 100644 index 363df834..00000000 --- a/PHP/Manager/Include/Pages/003-TenantManagementPage.inc.php +++ /dev/null @@ -1,125 +0,0 @@ -Title = "Manage Tenant: " . $this->Tenant->URL; - } - - protected function RenderContent() - { - ?> -

Tenant: Tenant->URL); ?>

-
- TabPages[] = new TabPage("tabCustomProperties", "Custom Properties", null, null, null, function() - { - ?> - - - - - - - - Tenant->GetProperties(); - foreach ($properties as $property) - { - ?> - - - - - - - -
[+]PropertyDescriptionValue
[+]Name); ?>Description); ?>RenderEditor($this->Tenant->GetPropertyValue($property)); ?>
- TabPages[] = new TabPage("tabEnabledModules", "Enabled Modules", null, null, null, function() - { - ?> -

Click on a module name to configure the module on this tenant.

- - - - - - Tenant); - foreach ($modules as $module) - { - ?> - - - - - -
ModuleDescription
Enabled) { echo(" checked=\"checked\""); } ?> /> Tenant->URL . "/modules/" . $module->ID)); ?>">Title); ?>Description); ?>
- TabPages[] = new TabPage("tabGlobalObjects", "Global Objects", null, null, null, function() - { - ?> -

Lists all of the objects that are available on this tenant that are not associated with a particular Module.

- - - - - - - Tenant); - foreach ($objects as $object) - { - ?> - - - - - - -
ObjectDescriptionInstances
Tenant->URL . "/objects/" . $object->ID)); ?>">Name); ?>Description); ?>Tenant->URL . "/objects/" . $object->ID . "/instances")); ?>">CountInstances()); ?>
- Render(); - ?> -
- - ">Cancel -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/004-TenantModuleManagementPage.inc.php b/PHP/Manager/Include/Pages/004-TenantModuleManagementPage.inc.php deleted file mode 100644 index db81bf24..00000000 --- a/PHP/Manager/Include/Pages/004-TenantModuleManagementPage.inc.php +++ /dev/null @@ -1,95 +0,0 @@ -Module != null) - { - $this->Title = "Manage Tenant Module: " . $this->Module->Title . " on " . $this->Tenant->URL; - } - else - { - $this->Title = "Manage Tenant Modules: " . $this->Tenant->URL; - } - } - - protected function RenderContent() - { - if ($this->Module != null) - { - ?> -

Module: Module->Title); ?> on Tenant->URL); ?>

-

Module Configurable Properties

- - - - - - - Module->GetProperties(); - foreach ($properties as $property) - { - ?> - - - - - - -
[+]PropertyValue
[+]Title); ?>
- -

Tenant: Tenant->URL); ?>

- -

Tenant Enabled Modules

-

Click on a module name to configure it

- - - - - - Tenant); - foreach ($modules as $module) - { - ?> - - - - - -
ModuleDescription
Enabled) { echo(" checked=\"checked\""); } ?> /> Tenant->URL . "/modules/" . $module->ID)); ?>">Title); ?>Description); ?>
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/005-ModuleMainPage.inc.php b/PHP/Manager/Include/Pages/005-ModuleMainPage.inc.php deleted file mode 100644 index 6a884177..00000000 --- a/PHP/Manager/Include/Pages/005-ModuleMainPage.inc.php +++ /dev/null @@ -1,41 +0,0 @@ - -

Module Management

-

There are modules in total. Click a module name to configure that module.

- -
- ">Create New Module -
- - - - - - - - - - - -
ModuleDescription
ID)); ?>">Title); ?>Description); ?>
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/006-ModuleManagementPage.inc.php b/PHP/Manager/Include/Pages/006-ModuleManagementPage.inc.php deleted file mode 100644 index 212d3cc8..00000000 --- a/PHP/Manager/Include/Pages/006-ModuleManagementPage.inc.php +++ /dev/null @@ -1,84 +0,0 @@ -Title = "Manage Module: " . $this->Module->Title; - } - - protected function RenderContent() - { - ?> -

Module Management

-

Module->Title); ?>

- -
-

Information

- - - - - - - - - -
Title:
Description:
- -

Application Menu Items

- - - - - - - Module->GetMainMenuItems(); - foreach ($menuitems as $menuitem) - { - ?> - - - - - - -
TitleDescriptionTarget
Title); ?>Description); ?>TargetURL); ?>
- -

Module Pages

- - - - - - - - - -
URL
ID)); ?>">Title); ?>
-
- ">Back to Modules -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/007-DataCenterMainPage.inc.php b/PHP/Manager/Include/Pages/007-DataCenterMainPage.inc.php deleted file mode 100644 index dc58d8ac..00000000 --- a/PHP/Manager/Include/Pages/007-DataCenterMainPage.inc.php +++ /dev/null @@ -1,43 +0,0 @@ - -

Data Center Management

-

There are data centers in total. Click a data center name to configure that data center.

- -
- ">Create New Data Center -
- - - - - - - - - - - - - -
Data CenterDescriptionHostname
ID)); ?>">Title); ?>Description); ?>HostName); ?>
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/008-DataCenterManagementPage.inc.php b/PHP/Manager/Include/Pages/008-DataCenterManagementPage.inc.php deleted file mode 100644 index baaaf006..00000000 --- a/PHP/Manager/Include/Pages/008-DataCenterManagementPage.inc.php +++ /dev/null @@ -1,48 +0,0 @@ -Title = "Manage Data Center: " . $this->DataCenter->Title; - } - - protected function RenderContent() - { - ?> -

Data Center Management

-

DataCenter->Title); ?>

- -
-

Information

- - - - - - - - - - - - - -
Title:
Description:
Hostname:
- -
- ">Back to Data Centers -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/009-TenantObjectManagementPage.inc.php b/PHP/Manager/Include/Pages/009-TenantObjectManagementPage.inc.php deleted file mode 100644 index d8ce5094..00000000 --- a/PHP/Manager/Include/Pages/009-TenantObjectManagementPage.inc.php +++ /dev/null @@ -1,224 +0,0 @@ -CurrentObject != null) - { - $this->Title = "Manage Tenant Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL; - } - else - { - $this->Title = "Manage Tenant Objects: " . $this->CurrentTenant->URL; - } - } - - protected function RenderContent() - { - if ($this->CurrentObject != null) - { - ?> -

Object: CurrentObject->Name); ?> on CurrentTenant->URL); ?>

-
- TabPages[] = new TabPage("tabStaticProperties", "Static Properties", null, null, null, function() - { - ?> - - - - - - - - CurrentObject->GetProperties(); - foreach ($properties as $property) - { - ?> - - - - - - - -
[+]PropertyData TypeDefault Value
[+]Name); ?>DataType == null ? "(undefined)" : "DataType->ID) . "\">" . $property->DataType->Name . ""); ?> - DataType == null || $property->DataType->ColumnRendererCodeBlob == null) - { - ?> - - DataType->ColumnRendererCodeBlob, $property->Value); - } - ?> -
- TabPages[] = new TabPage("tabInstanceProperties", "Instance Properties", null, null, null, function() - { - ?> - - - - - - - - - - CurrentObject->GetInstanceProperties(); - foreach ($properties as $property) - { - ?> - - - - - - - -
[+]PropertyData TypeDefault Value
[+]Name); ?>DataType == null ? "(undefined)" : "DataType->ID) . "\">" . $property->DataType->Name . ""); ?> - RenderColumn(); - ?> -
- TabPages[] = new TabPage("tabStaticMethods", "Static Methods", null, null, null, function() - { - ?> - - - - - - - - CurrentObject->GetMethods(); - foreach ($methods as $method) - { - ?> - - - - - - - -
[+]MethodDescriptionReturn Data Type
[+]CurrentTenant->URL . "/objects/" . $this->CurrentObject->ID . "/methods/static/" . $method->ID)); ?>">Name); ?>Description); ?>DataType == null ? "(undefined)" : "" . $method->DataType->Name . ""); */ ?>
- TabPages[] = new TabPage("tabInstances", "Instances", null, null, null, function() - { - ?> - - - CurrentObject->GetInstanceProperties(); - foreach ($properties as $property) - { - if ($property->ColumnVisible) - { - echo(""); - } - } - ?> - - CurrentObject->GetInstances(); - foreach ($instances as $instance) - { - ?> - - ColumnVisible) - { - echo(""); - } - } - ?> - - -
" . $property->Name . "
"); - $value = $instance->GetPropertyValue($property); - $property->RenderColumn($value); - echo("
- Render(); - ?> - -
- - CurrentTenant->URL)); ?>">Cancel -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/010-TenantObjectMethodManagementPage.inc.php b/PHP/Manager/Include/Pages/010-TenantObjectMethodManagementPage.inc.php deleted file mode 100644 index a9ce1253..00000000 --- a/PHP/Manager/Include/Pages/010-TenantObjectMethodManagementPage.inc.php +++ /dev/null @@ -1,96 +0,0 @@ -StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/CodeMirror/StyleSheets/CodeMirror.css"); - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Addons/Edit/MatchBrackets.js"); - - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/clike/clike.js"); - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/php/php.js"); - } - - protected function Initialize() - { - if ($this->CurrentMethod != null) - { - $this->Title = "Manage Method: " . $this->CurrentMethod->Name . " on " . $this->CurrentObject->Name . "@" . $this->CurrentTenant->URL; - } - else - { - $this->Title = "Manage Methods for Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL; - } - } - - protected function RenderContent() - { - if ($this->CurrentObject != null) - { - ?> -

Method: CurrentMethod->Name); ?> on CurrentObject->Name); ?>@CurrentTenant->URL); ?>

- - - - - -
-

Code Blob

-
- - - -
- - CurrentTenant->URL . "/objects/" . $this->CurrentObject->ID)); ?>">Discard Changes -
-
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/011-TenantObjectInstanceBrowsePage.inc.php b/PHP/Manager/Include/Pages/011-TenantObjectInstanceBrowsePage.inc.php deleted file mode 100644 index 7d08c81e..00000000 --- a/PHP/Manager/Include/Pages/011-TenantObjectInstanceBrowsePage.inc.php +++ /dev/null @@ -1,75 +0,0 @@ -Title = "Browse Instances of Tenant Object: " . $this->CurrentObject->Name . " on " . $this->CurrentTenant->URL; - } - - protected function RenderContent() - { - if ($this->CurrentObject != null) - { - ?> -

Object: CurrentObject->Name); ?> on CurrentTenant->URL); ?>

-

Object Instances

- - - CurrentObject->GetInstanceProperties(); - foreach ($properties as $property) - { - if ($property->ColumnVisible) - { - echo(""); - } - } - ?> - - CurrentObject->GetInstances(); - foreach ($instances as $instance) - { - ?> - - ColumnVisible) - { - echo(""); - } - } - ?> - - -
" . $property->Name . "
"); - $value = $instance->GetPropertyValue($property); - $property->RenderColumn($value); - echo("
- \ No newline at end of file diff --git a/PHP/Manager/Include/Pages/012-DataTypeModifyPage.inc.php b/PHP/Manager/Include/Pages/012-DataTypeModifyPage.inc.php deleted file mode 100644 index 0daabe60..00000000 --- a/PHP/Manager/Include/Pages/012-DataTypeModifyPage.inc.php +++ /dev/null @@ -1,252 +0,0 @@ -StyleSheets[] = new WebStyleSheet("http://static.alcehosting.net/dropins/CodeMirror/StyleSheets/CodeMirror.css"); - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Addons/Edit/MatchBrackets.js"); - - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/clike/clike.js"); - $this->Scripts[] = new WebScript("http://static.alcehosting.net/dropins/CodeMirror/Scripts/Modes/php/php.js"); - } - - protected function Initialize() - { - if ($this->CurrentDataType != null) - { - $this->Title = "Manage Data Type: " . $this->CurrentDataType->Name; - } - else - { - $this->Title = "Manage Data Types"; - } - } - - protected function RenderContent() - { - if ($this->CurrentDataType != null) - { - ?> -

Modify Data Type: CurrentDataType->Name); ?>

-

Create Data Type

- - -
- CurrentDataType != null) - { - echo("CurrentDataType->ID . "\" />"); - } - - $fv = new FormView("fv"); - $fv->Items[] = new FormViewItemText("txtDataTypeName", "datatype_Name", "Name", $this->CurrentDataType->Name); - $fv->Items[0]->Required = true; - - $fv->Items[] = new FormViewItemMemo("txtDataTypeDescription", "datatype_Description", "Description", $this->CurrentDataType->Description); - $fv->Render(); - ?> - OnClientTabChanged = "tbs_OnClientTabChanged();"; - $tbs->TabPages[] = new TabPage("tabEncoder", "Encoder", null, null, null, function() - { - ?> - - TabPages[] = new TabPage("tabDecoder", "Decoder", null, null, null, function() - { - ?> - - TabPages[] = new TabPage("tabColumnRenderer", "Column Renderer", null, null, null, function() - { - ?> - - TabPages[] = new TabPage("tabEditorRenderer", "Editor Renderer", null, null, null, function() - { - ?> - - Render(); - ?> -
- - ">Cancel -
-
- - - - - - - - - - - - -
NameDescription
ID)); ?>">Name); ?>Description); ?>
-
- ">Create New Data Type - ">Exit -
- Render(); - return true; - }), - new ModulePage("modify", function($path) - { - if ($_SERVER["REQUEST_METHOD"] == "POST") - { - if (isset($_POST["datatype_ID"])) - { - $datatype = DataType::GetByID($_POST["datatype_ID"]); - } - else - { - $datatype = new DataType(); - } - $datatype->Name = $_POST["datatype_Name"]; - $datatype->Description = $_POST["datatype_Description"]; - $datatype->EncoderCodeBlob = $_POST["datatype_EncoderCodeBlob"]; - $datatype->DecoderCodeBlob = $_POST["datatype_DecoderCodeBlob"]; - $datatype->ColumnRendererCodeBlob = $_POST["datatype_ColumnRendererCodeBlob"]; - $datatype->EditorRendererCodeBlob = $_POST["datatype_EditorRendererCodeBlob"]; - $datatype->Update(); - - System::Redirect("~/datatype"); - } - else - { - $page = new DataTypeModifyPage(); - $page->CurrentDataType = DataType::GetByID($path[0]); - $page->Render(); - } - return true; - }) - )) - )); -?> \ No newline at end of file diff --git a/PHP/Manager/Include/UUID.inc.php b/PHP/Manager/Include/UUID.inc.php deleted file mode 100644 index 431d1e94..00000000 --- a/PHP/Manager/Include/UUID.inc.php +++ /dev/null @@ -1,81 +0,0 @@ -urand = @fopen ( '/dev/urandom', 'rb' ); - } - - public static function Generate() - { - $uuid = new UUID(); - return $uuid->get(); - } - - /** - * @brief Generates a Universally Unique IDentifier, version 4. - * - * This function generates a truly random UUID. The built in CakePHP String::uuid() function - * is not cryptographically secure. You should uses this function instead. - * - * @see http://tools.ietf.org/html/rfc4122#section-4.4 - * @see http://en.wikipedia.org/wiki/UUID - * @return string A UUID, made up of 32 hex digits and 4 hyphens. - */ - function get() { - - $pr_bits = false; - if (is_a ( $this, 'uuid' )) { - if (is_resource ( $this->urand )) { - $pr_bits .= @fread ( $this->urand, 16 ); - } - } - if (! $pr_bits) { - $fp = @fopen ( '/dev/urandom', 'rb' ); - if ($fp !== false) { - $pr_bits .= @fread ( $fp, 16 ); - @fclose ( $fp ); - } else { - // If /dev/urandom isn't available (eg: in non-unix systems), use mt_rand(). - $pr_bits = ""; - for($cnt = 0; $cnt < 16; $cnt ++) { - $pr_bits .= chr ( mt_rand ( 0, 255 ) ); - } - } - } - $time_low = bin2hex ( substr ( $pr_bits, 0, 4 ) ); - $time_mid = bin2hex ( substr ( $pr_bits, 4, 2 ) ); - $time_hi_and_version = bin2hex ( substr ( $pr_bits, 6, 2 ) ); - $clock_seq_hi_and_reserved = bin2hex ( substr ( $pr_bits, 8, 2 ) ); - $node = bin2hex ( substr ( $pr_bits, 10, 6 ) ); - - /** - * Set the four most significant bits (bits 12 through 15) of the - * time_hi_and_version field to the 4-bit version number from - * Section 4.1.3. - * @see http://tools.ietf.org/html/rfc4122#section-4.1.3 - */ - $time_hi_and_version = hexdec ( $time_hi_and_version ); - $time_hi_and_version = $time_hi_and_version >> 4; - $time_hi_and_version = $time_hi_and_version | 0x4000; - - /** - * Set the two most significant bits (bits 6 and 7) of the - * clock_seq_hi_and_reserved to zero and one, respectively. - */ - $clock_seq_hi_and_reserved = hexdec ( $clock_seq_hi_and_reserved ); - $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2; - $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000; - - return strtoupper( sprintf ( '%08s%04s%04x%04x%012s', $time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node ) ); - } - - public static function format($input) - { - $output = $input; - $output = substr($output, 0, 8) . "-" . substr($output, 8, 4) . "-" . substr($output, 12, 4) . "-" . substr($output, 16, 4) . "-" . substr($output, 20); - return "{" . $output . "}"; - } -} -?> \ No newline at end of file diff --git a/PHP/Manager/index.php b/PHP/Manager/index.php deleted file mode 100644 index 33eb33c3..00000000 --- a/PHP/Manager/index.php +++ /dev/null @@ -1,41 +0,0 @@ -. - // ============================================================================= - - // We need to get the root path of the Web site. It's usually something like - // /var/www/yourdomain.com. - global $RootPath; - $RootPath = dirname(__FILE__); - - // Now that we have defined the root path, load the WebFX content (which also - // include_once's the modules and other WebFX-specific stuff) - require_once("WebFX/WebFX.inc.php"); - require_once("Include/UUID.inc.php"); - - // Bring in the WebFX\System and WebFX\IncludeFile classes so we can simply refer - // to them (in this file only) as "System" and "IncludeFile", respectively, from - // now on - use WebFX\System; - use WebFX\IncludeFile; - - // Tell WebFX that we are ready to launch the application. This cycles through - // all of the modules (usually you will define your main application content in - // 000-Default) and executes the first module page that corresponds to the path - // the user is GETting. - System::Launch(); -?> \ No newline at end of file diff --git a/PHP/Manager/lessc.php b/PHP/Manager/lessc.php deleted file mode 100644 index 696fc5f5..00000000 --- a/PHP/Manager/lessc.php +++ /dev/null @@ -1,29 +0,0 @@ -formatterName = "compressed"; - $v = $less->compileFile($filename . ".less"); - - echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n"); - echo("/* for human-readable source of this file, replace .css with .less in the file name */\n"); - echo($v); - } - catch (Exception $e) - { - echo "/* " . $e->getMessage() . " */\n"; - } -} -?> \ No newline at end of file diff --git a/PHP/Tenant/.htaccess b/PHP/Tenant/.htaccess deleted file mode 100644 index c6dacc11..00000000 --- a/PHP/Tenant/.htaccess +++ /dev/null @@ -1,10 +0,0 @@ -RewriteEngine On - -# Do not remove this line, otherwise mod_rewrite rules will stop working -RewriteBase / - -RewriteRule ^StyleSheets/(.*)\.css$ lessc.php?filename=$1 [PT,L,QSA] - -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ index.php?virtualpath=$1 [PT,L,QSA] diff --git a/PHP/Tenant/Include/Modules/000-Default/Main.inc.php b/PHP/Tenant/Include/Modules/000-Default/Main.inc.php deleted file mode 100644 index 5b160d63..00000000 --- a/PHP/Tenant/Include/Modules/000-Default/Main.inc.php +++ /dev/null @@ -1,347 +0,0 @@ -query($query); - if ($result->num_rows < 1) return false; - return true; - } - - function GetResourceBundles() - { - $ResourceBundles = array - ( - new ResourceBundle("Common") - ); - - $tenant = Tenant::GetCurrent(); - - // References to ResourceBundle objects are stored in a MultipleInstanceProperty called "ResourceBundles" on the tenant - $bundles = $tenant->GetPropertyValue("ResourceBundles")->GetInstances(); - foreach ($bundles as $bundle) - { - $ResourceBundles[] = new ResourceBundle($bundle->GetPropertyValue("Name")); - } - return $ResourceBundles; - } - function CompileStyleSheets($compile = true) - { - global $RootPath; - $ResourceBundles = GetResourceBundles(); - - $FilePaths = array(); - - $lesstext = ""; - foreach ($ResourceBundles as $bundle) - { - $lesstext .= $bundle->CompileStyleSheets(); - } - if ($compile) - { - try - { - $less = new \lessc(); - $less->setFormatter("compressed"); - $csstext = $less->compile($lesstext); - - echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n"); - echo("/* for human-readable source of this file, append ?compile=false to the file name */\n"); - echo($csstext); - } - catch (\Exception $e) - { - echo "/* " . $e->getMessage() . " */\n"; - } - } - else - { - echo($lesstext); - } - } - function CompileScripts($compile = true) - { - global $RootPath; - $ResourceBundles = GetResourceBundles(); - - $FilePaths = array(); - - $lesstext = ""; - foreach ($ResourceBundles as $bundle) - { - $lesstext .= $bundle->CompileScripts(); - } - - if ($compile) - { - try - { - $jstext = \JShrink\Minifier::minify($lesstext, array('flaggedComments' => false)); - - echo("/* compiled with JShrink v0.5.2 - BSD 3-clause - https://github.com/tedivm/JShrink */\n"); - echo("/* for human-readable source of this file, append ?compile=false to the file name */\n"); - echo($jstext); - } - catch (\Exception $e) - { - echo "/* " . $e->getMessage() . " */\n"; - } - } - else - { - echo($lesstext); - } - } - - function IsValidUserOrGuest() - { - $CurrentTenant = Tenant::GetCurrent(); - - if (!isset($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]) && !isset($_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"])) return true; - $user = User::GetByLoginID($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]); - if ($user == null) return true; - - return IsAuthenticated(); - } - function IsAuthenticated() - { - $CurrentTenant = Tenant::GetCurrent(); - - if (isset($_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]) && isset($_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"])) - { - $user = $CurrentTenant->GetObject("User")->GetMethod("ValidateCredentials")->Execute(array - ( - new TenantObjectMethodParameterValue("username", $_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"]), - new TenantObjectMethodParameterValue("password", $_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"]) - )); - return ($user != null); - } - return false; - } - function IsModuleAuthenticationRequired($path) - { - switch ($path) - { - case "dashboard": - case "world": - { - return true; - } - } - return false; - } - - System::$BeforeLaunchEventHandler = function($path) - { - if ($path[0] == "images" || $path[0] == "StyleSheet.css" || $path[0] == "Script.js" || ($path[0] == "account" && ($path[1] == "login.page" || $path[1] == "register.page"))) return true; - - // ensure our tenant has not expired yet - $tenant = Tenant::GetByURL(System::$TenantName); - if ($tenant == null || $tenant->IsExpired()) - { - $page = new ErrorPage(); - $page->Message = "The specified tenant does not exist. Please contact the site administrator to resolve this problem."; - $page->Render(); - return false; - } - - if (!IsConfigured() && $path[0] != "setup") - { - System::Redirect("~/setup"); - return false; - } - if (!IsValidUserOrGuest()) - { - System::Redirect("~/account/login.page"); - return false; - } - - if (!IsAuthenticated() && IsModuleAuthenticationRequired($path[0])) - { - System::Redirect("~/account/login.page"); - return false; - } - return true; - }; - - System::$Modules[] = new Module("net.Objectify.Default", array - ( - new ModulePage("", function($path) - { - if (IsAuthenticated()) - { - $tenant = Tenant::GetCurrent(); - $tobjUser = $tenant->GetObject("User"); - $instUser = $tobjUser->GetMethod("GetCurrentUser")->Execute(); - - $propStartPage = $tobjUser->GetInstanceProperty("StartPage"); - - $startPageSet = $instUser->HasPropertyValue($propStartPage); - $startPage = $instUser->GetPropertyValue($propStartPage); - - if ($startPageSet) - { - /* - $spi = $startPage->Instance; - $spio = $startPage->Instance->ParentObject; - $startPage = $spi->GetPropertyValue($spio->GetProperty("Value")); - */ - System::Redirect($startPage); - } - else - { - System::Redirect("~/dashboard"); - } - return true; - } - - $page = new MainPage(); - $page->Render(); - return true; - }), - new ModulePage("dashboard", function($path) - { - $page = new DashboardPage(); - $page->Render(); - return true; - }), - new ModulePage("account", array - ( - new ModulePage("login.page", function($path) - { - $CurrentTenant = Tenant::GetCurrent(); - if ($CurrentTenant == null) return false; - - $page = new LoginPage(); - if (isset($_POST["member_username"]) && isset($_POST["member_password"])) - { - $object = $CurrentTenant->GetObject("User"); - $inst = $object->GetMethod("ValidateCredentials")->Execute(array - ( - new TenantObjectMethodParameterValue("username", $_POST["member_username"]), - new TenantObjectMethodParameterValue("password", $_POST["member_password"]) - )); - - if ($inst != null) - { - $_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"] = $_POST["member_username"]; - $_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"] = $_POST["member_password"]; - - if (isset($_SESSION["LoginRedirectURL"])) - { - System::Redirect($_SESSION["LoginRedirectURL"]); - } - else - { - System::Redirect("~/"); - } - return true; - } - else - { - $page->InvalidCredentials = true; - } - } - $page->Render(); - return true; - }), - new ModulePage("logout.page", function($path) - { - $CurrentTenant = Tenant::GetCurrent(); - - $_SESSION["CurrentUserName[" . $CurrentTenant->ID . "]"] = null; - $_SESSION["CurrentPassword[" . $CurrentTenant->ID . "]"] = null; - System::Redirect("~/"); - }) - )), - new ModulePage("images", function($path) - { - // load images from resources object - global $RootPath; - - $bundle = "Common"; - $filename = implode("/", $path); - if (isset($path[1])) - { - if ($path[1] != "") - { - $bundle = $path[0]; - array_shift($path); - $filename = implode("/", $path); - } - } - - $imagePath = $RootPath . "/Resources/" . $bundle . "/Images/" . implode("/", $path); - if (file_exists($imagePath)) - { - header("Content-Type: " . mime_content_type($imagePath)); - readfile($imagePath); - return true; - } - else - { - header("HTTP/1.1 404 Not Found"); - echo("The specified resource file was not found on this server."); - return false; - } - }), - new ModulePage("StyleSheet.css", function($path) - { - header("Content-Type: text/css"); - $compile = true; - if (isset($_GET["compile"])) $compile = ($_GET["compile"] != "false"); - $lesstext = CompileStyleSheets($compile); - echo($lesstext); - return true; - }), - new ModulePage("Script.js", function($path) - { - // load style sheet from resources object - header("Content-Type: text/javascript"); - $compile = true; - if (isset($_GET["compile"])) $compile = ($_GET["compile"] != "false"); - $lesstext = CompileScripts($compile); - echo($lesstext); - return true; - }) - )); -?> \ No newline at end of file diff --git a/PHP/Tenant/Include/Modules/000-Default/ResourceBundle.inc.php b/PHP/Tenant/Include/Modules/000-Default/ResourceBundle.inc.php deleted file mode 100644 index 8cef5d27..00000000 --- a/PHP/Tenant/Include/Modules/000-Default/ResourceBundle.inc.php +++ /dev/null @@ -1,192 +0,0 @@ -Name = $name; - } - - public function MakeRelativePath($filename) - { - global $RootPath; - if (substr($filename, 0, strlen($RootPath)) == $RootPath) - { - return "~/" . substr($filename, strlen($RootPath) + 1); - } - return $filename; - } - - // BEGIN: function from Sven Arduwie (http://us2.php.net/manual/en/function.realpath.php#84012) - public function get_absolute_path($path) - { - $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); - $parts = explode(DIRECTORY_SEPARATOR, $path); - $absolutes = array(); - foreach ($parts as $part) - { - if ('.' == $part) continue; - if ('..' == $part) - { - array_pop($absolutes); - } - else - { - $absolutes[] = $part; - } - } - return implode(DIRECTORY_SEPARATOR, $absolutes); - } - // END: function from Sven Arduwie (http://us2.php.net/manual/en/function.realpath.php#84012) - - public function MakeAbsolutePath($filename, $relativeTo = null) - { - global $RootPath; - if (strlen($filename) > 3 && substr($filename, 0, 3) == "../") - { - if ($relativeTo != null) - { - $path = $relativeTo . "/" . $filename; - return $this->get_absolute_path($path); - } - return $this->get_absolute_path($filename); - } - else if (strlen($filename) > 1 && substr($filename, 0, 1) == "/") - { - return $filename; - } - if ($relativeTo != null) - { - return $relativeTo . "/" . $filename; - } - return $RootPath . "/" . $filename; - } - - public function CompileImportableFile($filename, $importedFileName = null, $preprocessorToken = "#") - { - global $RootPath; - $filename = $this->MakeAbsolutePath($filename, dirname($importedFileName)); - $importedFileTitle = $this->MakeRelativePath($importedFileName); - - $lesstext = ""; - $filetitle = $this->MakeRelativePath($filename); - $lesstext .= "/* BEGIN FILE: " . $filetitle; - if ($importedFileTitle != null) - { - $lesstext .= " - IMPORTED FROM " . $importedFileTitle; - } - $lesstext .= " */\n"; - - if (file_exists($filename)) - { - $tmp = file_get_contents($filename); - if ($tmp === false) - { - $lesstext .= "/* ERROR: " . $filename . " */"; - } - else - { - $lesstext .= $tmp; - } - } - else - { - $lesstext .= "/*\n\tERROR: file does not exist\n\tFile name: \"" . $filename . "\""; - if ($importedFileTitle != null) - { - $lesstext .= "\n\tImported from: \"" . $importedFileTitle . "\""; - } - $lesstext .= "\n*/\n"; - } - $lesstext .= "\n"; - - $lesslines = explode("\n", $lesstext); - $lesstext = ""; - - $j = strlen($preprocessorToken . "import "); - foreach ($lesslines as $lessline) - { - if (substr(trim($lessline), 0, $j) == $preprocessorToken . "import ") - { - $importfilename = trim(substr($lessline, $j)); - $importfilename = substr($importfilename, 1, strlen($importfilename) - 3); // removes " and "; - - $lesstext .= $this->CompileImportableFile($importfilename, $filename, $preprocessorToken); - } - else - { - $lesstext .= $lessline . "\n"; - } - } - - $lesstext .= "/* END FILE: " . $filetitle; - if ($importedFileTitle != null) - { - $lesstext .= " - IMPORTED FROM " . $importedFileTitle; - } - $lesstext .= " */\n\n"; - return $lesstext; - } - - public function CompileStyleSheets() - { - global $RootPath; - $StyleSheetPath = $RootPath . "/Resources/" . $this->Name . "/StyleSheets"; - $lesstext = ""; - - $lesstext .= "/* BEGIN BUNDLE: " . $this->Name . " */\n"; - - $lesstext .= "/* include path: " . $StyleSheetPath . " - "; - - $lessFiles = glob($StyleSheetPath . "/*.less"); - $lesstext .= count($lessFiles) . " *.less files, "; - $cssFiles = glob($StyleSheetPath . "/*.css"); - $lesstext .= count($cssFiles) . " *.css files"; - $lesstext .= " */\n\n"; - - foreach ($lessFiles as $filename) - { - $lesstext .= $this->CompileImportableFile($filename, null, "@"); - } - foreach ($cssFiles as $filename) - { - $lesstext .= $this->CompileImportableFile($filename, null, "@"); - } - $lesstext .= "/* END BUNDLE: " . $this->Name . " */\n\n"; - return $lesstext; - } - - public function CompileScripts() - { - global $RootPath; - $ContentPaths = array - ( - "", - "Controls", - "Objects" - ); - $BasePath = $RootPath . "/Resources/" . $this->Name . "/Scripts"; - $lesstext = ""; - - $lesstext .= "/* BEGIN BUNDLE: " . $this->Name . " */\n"; - foreach ($ContentPaths as $ContentPath) - { - $truepath = $BasePath . "/" . $ContentPath; - $lesstext .= "/* include path: " . $truepath . " - "; - - $jsfiles = glob($truepath . "/*.js"); - $lesstext .= count($jsfiles) . " *.js files"; - $lesstext .= " */\n\n"; - - foreach ($jsfiles as $filename) - { - $lesstext .= $this->CompileImportableFile($filename, null, "@"); - } - } - $lesstext .= "/* END BUNDLE: " . $this->Name . " */\n\n"; - return $lesstext; - } - } -?> \ No newline at end of file diff --git a/PHP/Tenant/index.php b/PHP/Tenant/index.php deleted file mode 100644 index cba49567..00000000 --- a/PHP/Tenant/index.php +++ /dev/null @@ -1,46 +0,0 @@ -. - // ============================================================================= - - // We need to get the root path of the Web site. It's usually something like - // /var/www/yourdomain.com. - global $RootPath; - $RootPath = dirname(__FILE__); - - // Now that we have defined the root path, load the WebFX content (which also - // include_once's the modules and other WebFX-specific stuff) - require_once("WebFX/WebFX.inc.php"); - require_once("Include/UUID.inc.php"); - - // Bring in the WebFX\System and WebFX\IncludeFile classes so we can simply refer - // to them (in this file only) as "System" and "IncludeFile", respectively, from - // now on - use WebFX\System; - use WebFX\IncludeFile; - - // Tell WebFX that this is a tenanted hosting application. This will allow us to - // control much of the application through Tenant Manager rather than having to - // continually push out code updates. - System::$EnableTenantedHosting = true; - - // Tell WebFX that we are ready to launch the application. This cycles through - // all of the modules (usually you will define your main application content in - // 000-Default) and executes the first module page that corresponds to the path - // the user is GETting. - System::Launch(); -?> \ No newline at end of file diff --git a/PHP/Tenant/lessc.php b/PHP/Tenant/lessc.php deleted file mode 100644 index 696fc5f5..00000000 --- a/PHP/Tenant/lessc.php +++ /dev/null @@ -1,29 +0,0 @@ -formatterName = "compressed"; - $v = $less->compileFile($filename . ".less"); - - echo("/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n"); - echo("/* for human-readable source of this file, replace .css with .less in the file name */\n"); - echo($v); - } - catch (Exception $e) - { - echo "/* " . $e->getMessage() . " */\n"; - } -} -?> \ No newline at end of file