diff options
author | Daniel <darthdaniel85@gmail.com> | 2013-11-18 14:44:44 -0800 |
---|---|---|
committer | Daniel <darthdaniel85@gmail.com> | 2013-11-18 14:44:44 -0800 |
commit | 85ca63b0896be3d12a098b44b5ec0c65a5b76a6c (patch) | |
tree | 86af33cb199088d65389bfb83cacf94a3db2a88b | |
parent | 7a047bedd98b47a82263e81bf62ef3890947f6ac (diff) |
WSAT Login...
-rw-r--r-- | framework/Wsat/TWsatService.php | 25 | ||||
-rw-r--r-- | framework/Wsat/pages/TWsatLogin.page | 53 | ||||
-rw-r--r-- | framework/Wsat/pages/config.xml | 6 | ||||
-rw-r--r-- | framework/Wsat/pages/layout/TWsatLayout.php | 2 | ||||
-rw-r--r-- | framework/Wsat/pages/layout/TWsatLayout.tpl | 2 | ||||
-rw-r--r-- | framework/Wsat/themes/PradoSoft/main.css (renamed from framework/Wsat/themes/PradoSoft/style.css) | 12 |
6 files changed, 80 insertions, 20 deletions
diff --git a/framework/Wsat/TWsatService.php b/framework/Wsat/TWsatService.php index 009ad302..de2bbdf6 100644 --- a/framework/Wsat/TWsatService.php +++ b/framework/Wsat/TWsatService.php @@ -6,6 +6,15 @@ * @version 1.0
* @author Daniel Sampedro darthdaniel85@gmail.com
* @since Prado 3.3
+ *
+ * To use TWsatService, configure it in the application specification like following:
+ * <code>
+ * <services>
+ * <service id="wsat" class="System.Wsat.TWsatService" Password="my_secret_password" />
+ * </services>
+ * </code>
+ * ...and then you need to go to http://localhost/yoursite/index.php?wsat=TWsatLogin
+ * and generate code and configure your site.
*/
class TWsatService extends TPageService {
@@ -13,15 +22,15 @@ class TWsatService extends TPageService { //-----------------------------------------------------------------------------
public function init($config) {
- if ($this->getApplication()->getMode() === TApplicationMode::Performance
- || $this->getApplication()->getMode() === TApplicationMode::Normal) {
+ if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal) {
throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes.");
}
if (empty($this->_pass)) {
throw new TConfigurationException("You need to specify the Password attribute.");
}
$this->setDefaultPage("TWsatHome");
- parent::init($config);
+ $this->_startThemeManager();
+ parent::init($config);
}
public function getBasePath() {
@@ -29,6 +38,16 @@ class TWsatService extends TPageService { return realpath($basePath);
}
+ private function _startThemeManager() {
+ $themeManager = new TThemeManager;
+ $themeManager->BasePath = "System.Wsat.themes";
+ $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
+ $themeManager->BaseUrl = $url . DIRECTORY_SEPARATOR . "themes";
+
+ $themeManager->init(null);
+ $this->setThemeManager($themeManager);
+ }
+
public function getPassword() {
return $this->_pass;
}
diff --git a/framework/Wsat/pages/TWsatLogin.page b/framework/Wsat/pages/TWsatLogin.page index dada4248..b256d719 100644 --- a/framework/Wsat/pages/TWsatLogin.page +++ b/framework/Wsat/pages/TWsatLogin.page @@ -1,9 +1,44 @@ -<com:TContent ID="Content"> - <div> - <com:TLabel Text="Password:" ForControl="password"/> - <com:TTextBox ID="password" /> - </div> - - <br/> - <com:TButton Text="Login" OnClick="login" /> -</com:TContent> +<%@ MasterClass="" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <com:THead Title="PRADO - WSAT"> + <com:TMetaTag HttpEquiv="Content-Type" Content="text/html; charset=utf-8" /> + <com:TMetaTag HttpEquiv="Content-Language" Content="en" /> + </com:THead> + + <body> + <com:TForm> + + <div id="header"> + <a href="<%= $this->Service->DefaultPageUrl %>"> + <div class="logo"></div> + <div style="float: left; margin-top: 17px">PRADO <br /> Web Site Administration Tool</div> + </a> + <div class="mantisbg"></div> + <div style="clear: both"></div> + </div> + + <div class="mainmenu"> + <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/" Text="PradoSoft.com" Target="_blank" /> | </div> + <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" /> | </div> + <div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" /> | </div> + <div style="clear: both"></div> + </div> + + <div class="login_form"> + <com:TLabel Text="Please enter your password:" ForControl="password"/><br/> + <com:TTextBox ID="password" TextMode="Password" style="margin: 5px" /><br/> + <com:TRequiredFieldValidator ControlToValidate="password" Text="Password cannot be blank." /><br/> + + <com:TButton Text="Enter" OnClick="login" /> + </div> + + <div id="footer"> + Copyright © 2005-<%= date('Y') %> <a href="http://www.pradosoft.com">PradoSoft</a>. + <br/><br/> + <%= Prado::poweredByPrado() %> + </div> + </com:TForm> + </body> +</html> diff --git a/framework/Wsat/pages/config.xml b/framework/Wsat/pages/config.xml index 832b6cc3..3ed8ea41 100644 --- a/framework/Wsat/pages/config.xml +++ b/framework/Wsat/pages/config.xml @@ -1,9 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<configuration> - <modules> - <module id="wsat_theme" class="System.Web.UI.TThemeManager" BasePath="System.Wsat.themes" /> - </modules> - +<configuration> <pages Theme="PradoSoft" MasterClass="System.Wsat.pages.layout.TWsatLayout" /> </configuration>
\ No newline at end of file diff --git a/framework/Wsat/pages/layout/TWsatLayout.php b/framework/Wsat/pages/layout/TWsatLayout.php index 30e52f44..e799125b 100644 --- a/framework/Wsat/pages/layout/TWsatLayout.php +++ b/framework/Wsat/pages/layout/TWsatLayout.php @@ -9,7 +9,7 @@ class TWsatLayout extends TTemplateControl { public function onLoad($param) {
parent::onLoad($param);
- $this->validateSecurity();
+ $this->validateSecurity();
}
private function validateSecurity() {
diff --git a/framework/Wsat/pages/layout/TWsatLayout.tpl b/framework/Wsat/pages/layout/TWsatLayout.tpl index 47068a3f..37cf4183 100644 --- a/framework/Wsat/pages/layout/TWsatLayout.tpl +++ b/framework/Wsat/pages/layout/TWsatLayout.tpl @@ -23,7 +23,7 @@ <div style="float: right"><com:THyperLink NavigateUrl="<%= $this->Service->DefaultPageUrl %>" Text="Web App" Target="_blank" /> | </div>
<div style="float: right"><com:THyperLink NavigateUrl="http://www.pradosoft.com/forum/" Text="Help" Target="_blank" /> | </div>
<div style="clear: both"></div>
- </div>
+ </div>
<div id="central_div">
<div id="toc">
diff --git a/framework/Wsat/themes/PradoSoft/style.css b/framework/Wsat/themes/PradoSoft/main.css index 5424388b..6c609e95 100644 --- a/framework/Wsat/themes/PradoSoft/style.css +++ b/framework/Wsat/themes/PradoSoft/main.css @@ -110,7 +110,17 @@ html, body{ }
.in_text{
- width: 250px;
+ width: 250px;
+}
+
+.login_form{
+ text-align: center;
+ margin: 30px auto;
+ border: 1px solid red;
+ border-radius: 5px;
+ padding: 10px;
+ width: 250px;
+ font-size: 11px;
}
#footer {
|