示例#1
0
 /**
  * Logs in a user using the provided username and password.
  * @return boolean whether the user is logged in successfully
  */
 public function login()
 {
     if ($this->validate()) {
         if ($this->isExpired()) {
             $this->addError('username', 'Sorry, your account has expired');
             return false;
         } else {
             $start_date = null;
             if ($this->isDelayed($start_date)) {
                 /** @var DateTime $start_date */
                 $this->addError('username', 'Sorry, your account will start in ' . $start_date->format('jS \\of F') . ' (' . UtilityHelpers::getTimeDelayed($start_date) . ')');
                 return false;
             }
         }
         return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
     } else {
         return false;
     }
 }
示例#2
0
文件: index.php 项目: abutouq/video
                        <h1>
                            Sorry, No videos available for now
                        </h1>
                    </div>
                </div>
            </div>
        </li>
        <!-- END timeline item -->
        <?php 
} else {
    $timeline_date = '';
    foreach ($dataProvider->getModels() as $model) {
        $date_create = new DateTime($model->create_date);
        $date_now = new DateTime();
        $time = UtilityHelpers::getTimeElapsed($model->create_date);
        $videoInfo = VideoHelpers::getVideoInfo($model->video_url);
        ?>
            <!-- timeline time label -->
            <?php 
        if ($date_create->format('d M Y') != $timeline_date) {
            ?>
            <?php 
            $timeline_date = $date_create->format('d M Y');
            ?>
            <li class="time-label">
        <span class="bg-green">
            <?php 
            echo Yii::t('app', '{0, date, d MMM Y}', strtotime($model->create_date));
            ?>
        </span>
示例#3
0
文件: index_1.php 项目: abutouq/video
                  <tr>
                    <td><input type="checkbox"></td>
                    <td class="mailbox-name"><a href="<?php 
    echo Url::to(['/messages/read', 'id' => $model->id]);
    ?>
"><?php 
    echo $model->sender->full_name;
    ?>
</a></td>
                    <td class="mailbox-subject"><?php 
    echo substr($model->message, 0, 30) . ' ...';
    ?>
</td>
                    <td class="mailbox-attachment"></td>
                    <td class="mailbox-date"><?php 
    echo UtilityHelpers::getTimeElapsed($model->send_at);
    ?>
</td>
                  </tr>
                  <?php 
}
?>
                
                  </tbody>
                </table>
                <!-- /.table -->
              </div>
              <!-- /.mail-box-messages -->
            </div>
            <!-- /.box-body -->
            <div class="box-footer no-padding">