Commits

Jacob Moen committed ff78c38

Basic skeleton works - now on to backporting the application

  • Participants
  • Parent commits a436e21
  • Branches boosted

Comments (0)

Files changed (7)

File backend/config/main-local.php

 
 return array(
 	'components' => array(
-//		'db'=> array(
-//			'connectionString' => $params['db.connectionString'],
-//			'username' => $params['db.username'],
-//			'password' => $params['db.password'],
-//			'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
-//			'enableParamLogging' => YII_DEBUG,
-//			'charset' => 'utf8'
-//		),
+		'db'=> array(
+			'connectionString' => $params['db.connectionString'],
+			'username' => $params['db.username'],
+			'password' => $params['db.password'],
+			'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
+			'enableParamLogging' => YII_DEBUG,
+			'charset' => 'utf8'
+		),
 		'urlManager' => array(
 			'urlFormat' => $params['url.format'],
 			'showScriptName' => $params['url.showScriptName'],
 			'rules' => $params['url.rules']
 		)
 	)
-);
+);

File frontend/config/main.php

 		// @see http://www.yiiframework.com/doc/api/1.1/CApplication#language-detail
 		'language' => 'en',
 		// uncomment if a theme is used
-		/*'theme' => '',*/
+		//'theme' => 'bootstrap',
 		// setup import paths aliases
 		// @see http://www.yiiframework.com/doc/api/1.1/YiiBase#import-detail
 		'import' => array(
 			'common.models.*',
 			// uncomment if behaviors are required
 			// you can also import a specific one
-			/* 'common.extensions.behaviors.*', */
+			 'common.extensions.behaviors.*', 
 			// uncomment if validators on common folder are required
-			/* 'common.extensions.validators.*', */
+			'common.extensions.validators.*', 
 			'application.components.*',
 			'application.controllers.*',
 			'application.models.*'
 				// @see http://www.yiiframework.com/doc/api/1.1/CErrorHandler#errorAction-detail
 				'errorAction'=>'site/error'
 			),
-//			'db' => array(
-//				'connectionString' => $params['db.connectionString'],
-//				'username' => $params['db.username'],
-//				'password' => $params['db.password'],
-//				'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
-//				'enableParamLogging' => YII_DEBUG,
-//				'charset' => 'utf8'
-//			),
+			'db' => array(
+				'connectionString' => $params['db.connectionString'],
+				'username' => $params['db.username'],
+				'password' => $params['db.password'],
+				'schemaCachingDuration' => YII_DEBUG ? 0 : 86400000, // 1000 days
+				'enableParamLogging' => YII_DEBUG,
+				'charset' => 'utf8'
+			),
 			'urlManager' => array(
 				'urlFormat' => 'path',
 				'showScriptName' => false,
 		),
 	),
 	CMap::mergeArray($mainEnvConfiguration, $mainLocalConfiguration)
-);
+);

File frontend/config/test.php

 				'class' => 'system.test.CDbFixtureManager'
 			),
 			/* uncomment if we require to run commands against test database */
-			/*
+			
 			 'db' => array(
 				'connectionString' => $params['testdb.connectionString'],
 				'username' => $params['testdb.username'],
 				'password' => $params['testdb.password'],
 				'charset' => 'utf8'
 			),
-			*/
+			
 
 		)
 	)
-);
+);

File frontend/controllers/SiteController.php

 
 		// collect user input data
 		if (isset($_POST['LoginForm'])) {
-			$model->attributes = $_POST['LoginForm'];
+			$model->username = $_POST['LoginForm']['username'];
+			$model->password = $_POST['LoginForm']['password'];
+			print_r($_POST['LoginForm']);
 			// validate user input and redirect to the previous page if valid
-			if ($model->validate() && $model->login())
+			if ($model->login())
 				$this->redirect(Yii::app()->user->returnUrl);
 		}
 		// display the login form
 	}
 
 
-}
+}

File frontend/views/site/index.php

  * Time: 8:30 PM
  */
 ?>
-This is index view file...
+This is index view file...
+And some other stuff
+<?php if (Yii::app()->user->isGuest): ?>
+    <?php echo CHtml::Link('Login', $this->createUrl('site/login')); ?>
+<?php else: ?>
+    <?php echo CHtml::Link('Logout', $this->createUrl('site/logout')); ?>
+    Logged in as: <?php echo Yii::app()->user->name; ?>
+<?php endif; ?>

File frontend/views/site/login.php

 
 <?php $form = $this->beginWidget('CActiveForm', array(
 	'id' => 'login-form',
-	'enableAjaxValidation' => false,
+	'enableAjaxValidation' => true,
 	'enableClientValidation' => true,
 	'clientOptions' => array(
 		'validateOnSubmit' => true,
 		<?php echo CHtml::submitButton('Login'); ?>
 	</div>
 
-<?php $this->endWidget(); ?>
+<?php $this->endWidget(); ?>

File frontend/www/index.php

 
 // On dev display all errors
 if (YII_DEBUG) {
-//	error_reporting(-1);
-//	ini_set('display_errors', true);
+	error_reporting(-1);
+	ini_set('display_errors', true);
 }
 
 date_default_timezone_set('UTC');
 $app->run();
 
 /* uncomment if you wish to debug your resulting config */
-/* echo '<pre>' . dump($config) . '</pre>'; */
+ // echo '<pre>' . dump($config) . '</pre>';