1
0

Added proper Log to msmain/index + added msmain/log + alot more

This commit is contained in:
2014-06-06 12:02:56 +02:00
parent d478647418
commit 53211ea359
30 changed files with 877 additions and 963 deletions

View File

@@ -4,9 +4,15 @@ class MSMainController extends MSController
{
public function actionIndex()
{
$data = array();
$criteria = new CDbCriteria;
$criteria->order = "date DESC";
$all_log = Log::model()->findAll($criteria);
/* @var $all_log Log[] */
$data = array();
$data['program'] = ProgramHelper::GetDailyProg();
$data['logs'] = $all_log;
$this->render('index', $data);
}
@@ -69,9 +75,6 @@ class MSMainController extends MSController
$this->render('about', $data);
}
/**
* Displays the login page
*/
public function actionLogin()
{
$model=new LoginForm;
@@ -95,12 +98,23 @@ class MSMainController extends MSController
$this->render('login', array('model'=>$model));
}
/**
* Logs out the current user and redirect to homepage.
*/
public function actionLogout()
{
Yii::app()->user->logout();
$this->redirect(Yii::app()->homeUrl);
}
public function actionLog($logid) {
$criteria = new CDbCriteria;
$criteria->order = "date DESC";
$all = Log::model()->findAll($criteria);
/* @var $all Log[] */
$this->render('log',
[
'logs' => $all,
'logid' => $logid,
]);
}
}