[puntoengine] r83 committed - * Finalize the install UI more beautiful...

0 views
Skip to first unread message

punto...@googlecode.com

unread,
Jul 15, 2011, 6:02:09 PM7/15/11
to punto...@googlegroups.com
Revision: 83
Author: jbalde
Date: Fri Jul 15 15:01:37 2011
Log: * Finalize the install UI more beautiful
* Create base of AdminController
* Added PuntoEngine logo
http://code.google.com/p/puntoengine/source/detail?r=83

Added:
/trunk/puntoengine/core/admin
/trunk/puntoengine/core/admin/AdminController.php
/trunk/puntoengine/core/admin/template
/trunk/puntoengine/core/resources/images/logo.png
Modified:
/trunk/puntoengine
/trunk/puntoengine/core/Kernel.php
/trunk/puntoengine/install.php

=======================================
--- /dev/null
+++ /trunk/puntoengine/core/admin/AdminController.php Fri Jul 15 15:01:37
2011
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Source code of AdminController class controller
+ * @category puntoengine
+ * @package core
+ * @subpackage admin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3
+ */
+
+
+/**
+ * AdminController is a controller class of the default admin
+ * @category puntoengine
+ * @package core
+ * @subpackage admin
+ * @author Juan Benavides Romero <juan.benav...@gmail.com>
+ * @since 0.3
+ */
+class AdminController extends HttpServlet {
+ protected $master = '/core/admin/template/master.php';
+
+
+ /**
+ * Implement the GET method connection and load the login form
+ * @param HttpRequest $request Page request
+ */
+ protected function doGet(HttpRequest $request) {
+ if($request->getSession('admin') == 'true') {
+ $this->master = null;
+ $this->setRequestDispatcher('/template/pepadmin/admin.php', $request);
+ } else {
+ $this->setRequestDispatcher('/template/pepadmin/login.php', $request);
+ }
+ }//doGet
+
+
+ /**
+ * Implement the POST method connection and check the user
+ * @param HttpRequest $request Page request
+ */
+ protected function doPost(HttpRequest $request) {
+ $document = new XmlDocument();
+ $document->loadXmlFile('/config/admin.xml');
+
+ try {
+ $admin =
$document->selectSingleNode('/Admin/Users/User[Credentials/@user="'.$request->getParam('user').'"
and Credentials/@pass="'.$request->getParam('pass').'"]');
+
+ if($admin != '') {
+ $request->addSession('admin', 'true');
+ }
+ } catch(Exception $ex) {
+ }
+
+ $this->sendRedirect('~/'.$this->url);
+ }//doPost
+}//PepAdminController
+?>
=======================================
--- /dev/null
+++ /trunk/puntoengine/core/resources/images/logo.png Fri Jul 15 15:01:37
2011
Binary file, no diff available.
=======================================
--- /trunk/puntoengine/core/Kernel.php Fri Jul 15 05:17:59 2011
+++ /trunk/puntoengine/core/Kernel.php Fri Jul 15 15:01:37 2011
@@ -6,6 +6,7 @@
* @author Juan Benavides Romero <juan.benav...@gmail.com>
* @since 0.1.1
*/
+Kernel::import('core.admin');
Kernel::import('core.exceptions');
Kernel::import('core.http');
Kernel::import('core.xml');
=======================================
--- /trunk/puntoengine/install.php Fri Jul 15 05:59:32 2011
+++ /trunk/puntoengine/install.php Fri Jul 15 15:01:37 2011
@@ -72,31 +72,58 @@
<header id="header">Intall</header>
<div id="wrapper">
<div id="container">
+ <header>
+ <div id="logo" class="minibox center">
+ <img src="core/resources/images/logo.png" alt="PuntoEngine"
title="PuntoEngine" />
+ </div>
+ </header>
<article>
<div class="container minibox">
<div class="content">
- <form method="post" action="~/admin/login">
+ <?php
+ if(isset($installed)) {
+ ?>
+ <h3>Remember remove the file install.php</h3>
+ <?php
+ if(!$htaccesswrited) {
+ ?>
+ .htaccess<br/>
+ <textarea cols="44" rows="15"><?php echo $htaccess; ?></textarea>
+ <br/><br/><br/>
+ <?php
+ }
+
+ if(!$adminwrited) {
+ ?>
+ config/admin.xml<br/>
+ <textarea cols="44" rows="15"><?php echo
$simple->asXML(); ?></textarea>
+ <?php
+ }
+ } else {
+ ?>
+ <form method="post" action="install.php">
<p>
- <label for="user">Usuario:<br/>
+ <label for="user">User:<br/>
<input type="text" name="user" id="user" autocomplete="off" />
</label>
</p>
<p>
- <label for="pass">Contraseña:<br/>
+ <label for="pass">Password:<br/>
<input type="password" name="pass" id="pass" autocomplete="off"
/>
</label>
</p>
<div class="float">
<div class="right">
- <input type="submit" value="Acceder" />
+ <input type="submit" name="install" value="Install" />
</div>
</div>
</form>
+ <?php
+ }
+ ?>
+
</div>
</div>
- <div class="minibox">
- <a href="#">¿Has perdido tu contraseña?</a>
- </div>
</article>
<footer class="center">
<p>PuntoEngine &copy; 2011</p>
@@ -105,52 +132,3 @@
</div>
</body>
</html>
-<!--
-<!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" dir="ltr" lang="es-ES">
- <head profile="http://gmpg.org/xfn/11">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Punto Engine PHP - Install</title>
- </head>
- <body>
- <h1>Install</h1>
-
- <?php
- if(isset($installed)) {
- ?>
- <h3>Remember remove the file install.php</h3>
- <?php
- if(!$htaccesswrited) {
- ?>
- .htaccess<br/>
- <textarea cols="50" rows="15"><?php echo $htaccess; ?></textarea>
- <br/><br/><br/>
- <?php
- }
-
- if(!$adminwrited) {
- ?>
- config/admin.xml<br/>
- <textarea cols="50" rows="15"><?php echo $simple->asXML(); ?></textarea>
- <?php
- }
- } else {
- ?>
- <h3>Remember that files .htaccess and config/admin.xml have
permissons</h3>
- <form method="post" action="install.php">
- <fieldset>
- <legend>Admin access</legend>
- <p>
- <label>User: <input type="text" name="user" /></label>
- </p>
- <p>
- <label>Pass: <input type="password" name="pass" /></label>
- </p>
- </fieldset>
- <input type="submit" name="install" value="install" />
- </form>
- <?php
- }
- ?>
- </body>
-</html> -->
Reply all
Reply to author
Forward
0 new messages