Example #1
0
 public function getLinkAttribute()
 {
     if ($this->type == 'public') {
         return home_url('/article/' . $this->slug);
     } else {
         return dashboard_url('article/show/' . $this->slug);
     }
 }
Example #2
0
 public function check()
 {
     if (!sentinel()->check()) {
         redirect('login', 'refresh');
     }
     if (!sentinel()->inRole($this->roles)) {
         redirect(dashboard_url(), 'refresh');
     }
 }
Example #3
0
 public function index()
 {
     $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
     $this->form_validation->set_rules('password', 'Password', 'required');
     if ($this->form_validation->run() == FALSE) {
         keepValidationErrors();
         $this->template->set_layout('login');
         $this->template->build('login');
     } else {
         $credentials = ['email' => set_value('email'), 'password' => set_value('password')];
         if (sentinel()->authenticate($credentials)) {
             $redirect_url = dashboard_url();
             redirect($redirect_url, 'refresh');
         } else {
             set_message_error('Email atau password Anda salah.');
             redirect(login_url(), 'refresh');
         }
     }
 }
Example #4
0
<?php

get_header('private', array('active' => 'kelas'));
?>

    <!-- start:main content -->
    <div class="container content content-single content-dashboard content-kelas-online">
        <section id="content">
            <div class="content-kelas-online-main">
                <!-- start:breadcrumb -->
                <div class="breadcrumbs">
                    <ol class="breadcrumb">
                        <li><a href="<?php 
echo dashboard_url();
?>
">Dashboard</a></li>
                        <li><a href="<?php 
echo site_url();
?>
">Kelas Online</a></li>
                        <li><a href="<?php 
echo site_url('course/show/' . $course->slug);
?>
"><?php 
echo $course->name;
?>
</a></li>
                        <li><a href="<?php 
echo site_url('course/showchapter/' . $course->slug . '/chapter-' . $chapter->order);
?>
"><?php 
Example #5
0
    ?>
                        <ul class="nav navbar-nav pull-right">
                            <div class="dropdown dropdown-people">
                                <a class="dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    <img src="<?php 
    echo sentinel()->getUser()->avatar;
    ?>
" alt="">
                                </a>
                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu2">
                                    <a href="<?php 
    echo dashboard_url('profile');
    ?>
" class="dropdown-item">Profile</a>
                                    <a href="<?php 
    echo dashboard_url('sendArticle');
    ?>
" class="dropdown-item">Artikel</a>
                                    <a href="<?php 
    echo logout_url();
    ?>
" class="dropdown-item">Log Out</a>
                                </div>
                            </div>
                        </ul>
                    <?php 
}
?>
                </div>
            </div>
        </nav>
Example #6
0
 public function getLinkPrivateAttribute()
 {
     return dashboard_url('category/show/' . $this->name);
 }
Example #7
0
 public function check()
 {
     if (sentinel()->check()) {
         redirect(dashboard_url(), 'refresh');
     }
 }
Example #8
0
        <li><a href="<?php 
echo dashboard_url();
?>
">Dashboard</a></li>
        <li><a href="<?php 
echo dashboard_url();
?>
">Article</a></li>
        <?php 
try {
    ?>
            <?php 
    $category = $article->categories()->firstOrFail();
    ?>
            <li><a href="<?php 
    echo dashboard_url('category/show/' . $category->name);
    ?>
"><?php 
    echo $category->name;
    ?>
</a></li>
        <?php 
} catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) {
}
?>
    </ol>
    <div class="single-article-title">
        <h1><?php 
echo $article->title;
?>
</h1>