function isAdministrator()
 {
     if(AccessHelper::isAdmin())
         return true;
     else
         return false;
 }
Exemple #2
0
 public function index()
 {
     if (AccessHelper::is_allowed()) {
         return View("Base::addons");
     } else {
         return \View('Base::Base.forbiden');
     }
 }
 public static function getActions()
 {
     if (!isset(self::$Accesss)) {
         $parser = new INIConfigurationParser();
         $parser->loadFile(BUSINESS . 'conf/access.ini');
         $parser->parse();
         self::$Accesss = $parser->getConfigs();
     }
     return self::$Accesss;
 }
Exemple #4
0
            'class'=>'DataColumn',
            'name' => 'alias',
            'type' => 'raw',
            'value' =>'$data->order == 0 ? "Виключено":"'.Yii::t('module', '0381').' {$data->order}."',
            'header'=>false,
            'htmlOptions'=>array('class'=>'aliasColumn'),
            'headerHtmlOptions'=>array('style'=>'width:0%; display:none'),
        ),
        array(
            'name' => 'title',
            'type' => 'raw',
            'header'=>false,
            'htmlOptions'=>array('class'=>'titleColumn'),
            'headerHtmlOptions'=>array('style'=>'width:0%; display:none'),
            'value' => function($data) {
            if (AccessHelper::accesLecture($data->id))
                return CHtml::link(CHtml::encode($data->title), Yii::app()->createUrl("lesson/index", array("id" => $data->id)));
            else
                return $data->title;
            }
        ),
    ),
    'summaryText' => '',
));
?>
    <div id="lessonForm">
        <?php $this->renderPartial('_addLessonForm', array('newmodel'=>$module)); ?>
    </div>
</div>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/scripts/lecturesList.js"></script>
  }
  uname = uname + last_name.replace(/\'/,'');
  uname = uname.toLowerCase();
  uname = uname + Math.ceil(Math.random()*10000);

  document.getElementById('student_uname').value = uname;
  document.getElementById('student_password').value = uname;
  document.getElementById('password_confirm').value = uname;
  document.getElementById('student_password_hint').value = 'Same as your username';
  document.getElementById('student_secret_question').value = 'What is your username';
  document.getElementById('student_secret_answer').value = uname;
  return true;
}
jQuery('.unamecheck').bind('blur', checkUname);
function clear_acct_info() {
  document.getElementById('student_password').value = '';
  document.getElementById('password_confirm').value = '';
  document.getElementById('student_password_hint').value = '';
  document.getElementById('student_secret_question').value = '';
  document.getElementById('student_secret_answer').value = '';
  return true;
}
//-->
</script>

<script type="text/javascript" src="<?php 
echo AccessHelper::get_path();
?>
/js/jquery.auto-uname.js"></script>
<?php 
include_partial('global/proctorfooter');
Exemple #6
0
<?php
/**
 * Created by PhpStorm.
 * User: Ivanna
 * Date: 12.05.2015
 * Time: 16:06
 */
if (AccessHelper::isAdmin()) $post->setScenario('canedit');
?>
<div class="leftModule">
    <div class="headerLeftModule">
        <?php
        if (AccessHelper::isAdmin())
        $this->renderPartial('_moduleInfoForAdmin', array('post'=>$post));
        else $this->renderPartial('_moduleInfo', array('post'=>$post));
        ?>
        <table>
            <tr>
                <td>
                    <div class="startModule">
                        <?php $labelButton = Yii::t('module', '0279')?>
                        <?php echo CHtml::link($labelButton, '#'); ?>
                    </div>
                </td>
                <td>
                    <div class="startCourse">
                        <?php $labelButton = Yii::t('module', '0280')?>
                        <?php echo CHtml::link($labelButton, '#'); ?>
                    </div>
                </td>
            </tr>
Exemple #7
0
 </li>
 <li>
     <?php echo $data['last_name']." ".$data['first_name']." ".$data['middle_name'];?>
 </li>
 <li>
     <?php echo $data['email']; ?>
 </li>
 <li>
     <?php echo $data['tel']; ?>
 </li>
 <li>
     <?php echo 'skype: '?>
     <span class="teacherSkype"><?php echo $data['skype']?></span>
 </li>
 <!--Календарь консультацій з календарем, часом консультацій і інформаційною формою-->
 <?php if(AccessHelper::canAddConsultation()){
     ?>
     <div class="calendar">
         <!--            Календарь-->
         <div class="input-append date form_datetime" id="form_datetime">
             <input size="16" type="text" value="" onchange="showTime('<?php echo $data['teacher_id']; ?>')" readonly id="<?php echo 'dateTimePicker'.$data['teacher_id']?>">
             <span class="add-on"><i class="icon-th"></i></span>
             <!--Скрита форма з Ajax кнопкою для передачі і виводу зайнятих інтервалів консультацій-->
             <?php $form=$this->beginWidget('CActiveForm', array(
                 'id'=>'ajaxchange-form',
             )); ?>
             <input type="hidden" id="<?php echo 'dateconsajax'.$data['teacher_id']?>" name="dateconsajax" />
             <input type="hidden" name="teacherIdajax" value=<?php echo $data['teacher_id']; ?> />
             <?php
             echo CHtml::ajaxSubmitButton('Updatedate', CController::createUrl('lesson/UpdateAjax'), array('update' => '#timeConsultation'.$data['teacher_id']), array('id' => 'hiddenAjaxButton'.$data['teacher_id']));
             ?>
    $knowldg= $teacherRat->knowledge;
    $behvr=$teacherRat->behavior;
    $motivtn=$teacherRat->motivation;
    $knowval=$knowldg;
    $behval=$behvr;
    $motivval=$motivtn;
} else{
    $knowldg='0';
    $behvr='0';
    $motivtn='0';
    $knowval=Null;
    $behval=Null;
    $motivval=Null;
}
?>
<?php if(AccessHelper::canAddResponse()){?>
<div class="lessonTask">
    <img class="lessonBut" src="<?php echo StaticFilesHelper::createPath('image', 'teachers', 'lessButton.png');?>">
    <div class="lessonButName" unselectable="on"><?php echo Yii::t('teacher', '0187'); ?></div>
    <div class="lessonLine"></div>
    <div class="responseBG">

        <div>
            <table style="padding-left: 35px; padding-top: 30px;">
                <tr>
                    <td align="right">
                        <b><?php echo  Yii::t('teacher', '0188'); ?></b>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                <?php $users = AccessHelper::generateTeachersList();
                $count = count($users);
                for($i = 0; $i < $count; $i++){
                    ?>
                    <option value="<?php echo $users[$i]['id'];?>"><?php echo $users[$i]['alias'];?></option>
                <?php
                }
                ?>
            </select>
            <br>
            <br>
            Курс:<br>
            <select name="course1" placeholder="(Виберіть курс)" onchange="javascript:selectModule1();">
                <option value="">Всі курси</option>
                <optgroup label="Виберіть курс">
                    <?php $courses = AccessHelper::generateCoursesList();
                    $count = count($courses);
                    for($i = 0; $i < $count; $i++){
                        ?>
                        <option value="<?php echo $courses[$i]['id'];?>"><?php echo $courses[$i]['alias'];?></option>
                    <?php
                    }
                    ?>
            </select>
            <br>
            <br>

            Модуль:<br>
            <div name="selectModule1" style="float:left;"></div>
            <br>
            <br>
Exemple #10
0
//set_error_handler("exception_error_handler");
require_once dirname(__FILE__) . '/../conf/configuration_front.php';
require_once dirname(__FILE__) . '/../core/autoloadManager.php';
autoloadManager::setSaveFile(dirname(__FILE__) . '/../tmp/front.php');
autoloadManager::addFolder(CORE);
autoloadManager::addFolder(BUSINESS);
spl_autoload_register('autoloadManager::loadClass');
$_REQUEST['controller'] = Toolbox::getArrayParameter($_REQUEST, 'controller', 'Feed');
$_REQUEST['action'] = Toolbox::getArrayParameter($_REQUEST, 'action', 'index');
// jquery based ajax application
$from = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 'XMLHttpRequest' === $_SERVER['HTTP_X_REQUESTED_WITH'] ? 'ajax' : 'http';
try {
    $front = frontDispatcher::getInstance();
    // Init Session
    // Save header for ajax call, so that we can either root or return false for ajax calls
    $actions = AccessHelper::getActions();
    // authenticate
    $AuthManager = new AuthManager($actions);
    $AuthManager->authenticate($front, '/?controller=Feed&action=index', $from);
    // Inject Dynamically changing objects
    $Container = ContainerFactory::get('front');
    $Container['Access'] = $actions;
    $Container['AuthManager'] = $AuthManager;
    $Container['Request'] = $_REQUEST;
    $Container['Session'] = SessionManager::getSession('front');
    // Route
    $front->route($Container);
} catch (Exception $e) {
    if ('ajax' == $from) {
        header('content-type: application/json');
        $params = array('error' => 'false', 'message' => $e->getMessage());
	/**
	 * Lists all models.
	 */
	public function actionIndex($id)
	{
        $criteria=new CDbCriteria();
        $criteria->addCondition('course='.$id);

        $dataProvider = new CActiveDataProvider('Module', array(
            'criteria' =>$criteria,
            'pagination'=>false,
            'sort'=>array(
                'defaultOrder'=>array(
                    'order'=>CSort::SORT_ASC,
                )
            )
        ));

        $dataProvider1 = new CActiveDataProvider('Teacher', array(
        ));

        $canEdit = AccessHelper::isAdmin();
        $model = Course::model()->findByPk($id);
        $modules = Module::getModules($id);

        $teachers = TeacherModule::getCourseTeachers($modules);
//        $user = Yii::app()->user->getId();
//        if ($user = Teacher::isTeacher($user)) {
//            if(Teacher::isTeacherCanEdit($user, $modules)){
//                $canEdit = true;
//            }
//            if(count($modules) <= 3){
//                $canEdit = true;
//        }
//        }

		$this->render('index',array(
			'model'=>$model,
            'modules' => $modules,
            'dataProvider' => $dataProvider,
            'canEdit' => $canEdit,
            'dataProvider1' => $dataProvider1,
            'teachers' => $teachers,
		));
	}