コード例 #1
0
ファイル: M_auth.php プロジェクト: urangawak/minangcms
 function login()
 {
     $token = tokenGenerate();
     $this->CI->m_security->filterPost('muser_' . $token, 'trim|required|min_length[1]');
     $this->CI->m_security->filterPost('mpass_' . $token, 'trim|required|min_length[1]');
     if ($this->CI->m_security->startPost() == TRUE) {
         $user = $this->CI->input->post('muser_' . $token, TRUE);
         $pass = $this->CI->input->post('mpass_' . $token, TRUE);
         $remember = $this->CI->input->post('mremember');
         $rememberX = '0';
         if ($remember) {
             $rememberX = '1';
         } else {
             $rememberX = '0';
         }
         $this->CI->load->library('auth/abstractauth');
         $proses = $this->CI->abstractauth->loginDo($user, $pass, $rememberX);
         if ($proses == FALSE) {
             redirect(base_url(routeGet('login') . '?s=2'), 'refresh');
         } else {
             runService('login', 'destroy');
             $checkUser = array('username' => $user);
             $userid = $this->CI->m_database->fieldRow('userlogin', $checkUser, 'user_id');
             $role = taxonomyRead($userid, 'role_user');
             $this->createSessionLogin($user, $role, $rememberX);
             redirect(base_url() . roleDirectUser(), 'refresh');
         }
     } else {
         redirect(base_url(routeGet('login') . '?s=1'), 'refresh');
     }
 }
コード例 #2
0
ファイル: Testing.php プロジェクト: urangawak/minangcms
 function index()
 {
     //$this->load->library('m_auth');
     //$this->load->view('testingview');
     redirect(base_url(routeGet('login')));
     //echo $this->session->userdata('bruceforce');
 }
コード例 #3
0
ファイル: user_helper.php プロジェクト: urangawak/minangcms
 function userInfo($output)
 {
     $CI =& get_instance();
     $sesuserdb = optionGet('session_user');
     $username = $CI->session->userdata($sesuserdb);
     $s = array('username' => $username, 'status' => 'active');
     if ($CI->m_database->isBOF('userlogin', $s) == TRUE) {
         redirect(base_url(routeGet('logout')), 'refresh');
     } else {
         $item = $CI->m_database->fieldRow('userlogin', $s, $output);
         if (!empty($item)) {
             return $item;
         } else {
             redirect(base_url(routeGet('logout')), 'refresh');
         }
     }
 }
コード例 #4
0
ファイル: Auth.php プロジェクト: urangawak/minangcms
 function freshinstall()
 {
     if ($this->hasUser() == FALSE) {
         $this->m_security->filterPost('username', 'required');
         $this->m_security->filterPost('password', 'required');
         $this->m_security->filterPost('nama', 'required');
         $this->m_security->filterPost('email', 'required');
         if ($this->m_security->startPost() == TRUE) {
             $username = $this->input->post('username', TRUE);
             $password = $this->input->post('password', TRUE);
             $nama = $this->input->post('nama', TRUE);
             $email = $this->input->post('email', TRUE);
             $this->m_auth->registerUser($username, $password, $nama, '', $email, '1', 'active');
             redirect(base_url(routeGet('login', 'route_key')), 'refresh');
         } else {
             $this->load->view('newuser');
         }
     } else {
         redirect(base_url(routeGet('login', 'route_key')), 'refresh');
     }
 }
コード例 #5
0
ファイル: widgetview.php プロジェクト: urangawak/minangcms
$titleBox = "";
$title = menuInfoJSON($widgetID, 'title');
if (!empty($title)) {
    $titleBox = $title;
} else {
    $titleBox = "Event Widget";
}
?>
<div class="widget widget-info">
<div class="widget-header">
	<h3 class="widget-title"><?php 
echo $titleBox;
?>
</h3>
	<div class="widget-tools pull-right"><a href="<?php 
echo base_url(routeGet('events', 'route_key'));
?>
">+ indexs</a></div>
</div>
<div class="widget-body">
<?php 
$para = array('post_type' => 'event');
$g = mc_allpost($para, "post_date DESC", "5");
if ($g['jumlah'] > 0) {
    foreach ($g['data'] as $r) {
        $tgl = "";
        $jam = "";
        $tglEvent = postTaxonomy($r->post_id, 'tanggal_event');
        $jamEvent = postTaxonomy($r->post_id, 'jam_event');
        if (!empty($tglEvent)) {
            $tgl = $tglEvent;
コード例 #6
0
ファイル: newuser.php プロジェクト: urangawak/minangcms
		  padding-top: 40px;
		  padding-bottom: 40px;
		  background-color: #eee;
		}
		.form-entri {
		  max-width: 768px;
		  padding: 15px;
		  margin: 0 auto;
		}
	</style>
  </head>
  <body>
    <div class="container">
    <div class="form-entri">	  
	  <form method="post" action="<?php 
echo base_url(routeGet('freshinstall', 'route_key'));
?>
">	  	
		<h4 class="text-center">New Administrator</h4>
		<div class="form-group">
	  		<label>Nama</label>			  		
	  		<input type="text" id="nama" name="nama" class="form-control" required="" value="" placeholder="Nama Akun Anda"/>			  		
	  	</div>
	  	<div class="form-group">
	  		<label>Username</label>			  		
	  		<input type="text" id="username" name="username" class="form-control" required="" value="" placeholder="Username untuk login"/>			  		
	  	</div>
	  	<div class="form-group">
	  		<label>Password</label>			  		
	  		<input type="password" id="password" name="password" class="form-control" required="" value="" placeholder="password untuk login"/>			  		
	  	</div>
コード例 #7
0
ファイル: loginview.php プロジェクト: urangawak/minangcms
<div class="form-top">
<div class="form-top-left">
	<h3>User Login</h3>                            		
</div>
<div class="form-top-right">
	<i class="fa fa-lock"></i>
</div>
</div>
<div class="form-bottom">
<?php 
$att = array('name' => 'loginform', 'id' => 'loginform', 'class' => 'registration-form');
echo form_open(base_url(routeGet('loginproccess')));
?>
	<div class="form-group">
	<label class="sr-only">Username</label>
    	<input type="text" name="<?php 
echo authForm('user');
?>
" class="form-control" autocomplete="off" id="<?php 
echo authForm('user', FALSE);
?>
" placeholder="Username Anda">
    </div>
    <div class="form-group">
    	<label class="sr-only">Password</label>
    	<input type="password" name="<?php 
echo authForm('pass');
?>
" class="form-control" autocomplete="off" id="<?php 
echo authForm('pass', FALSE);
?>
コード例 #8
0
ファイル: widgetview.php プロジェクト: urangawak/minangcms
<?php

foreach ($widgetdata as $rWidget) {
}
$widgetID = $rWidget['term_id'];
$titleBox = "";
$title = menuInfoJSON($widgetID, 'title');
if (!empty($title)) {
    $titleBox = $title;
} else {
    $titleBox = "Search Widget";
}
?>
<div class="widget-item" style="margin-bottom: 20px;">
<div class="widget-item-title"><?php 
echo $titleBox;
?>
</div>
<div class="widget-item-body">
<form method="get" action="<?php 
echo routeGet('search', 'route_key');
?>
">
	<input type="text" name="s" class="form-control"/>
</form>
</div>
</div>
コード例 #9
0
ファイル: header.php プロジェクト: urangawak/minangcms
?>
                    </p>
                  </li>                  
                  <li class="user-footer">
                    <div class="pull-left">
                      <a href="<?php 
echo base_url(roleURIUser() . 'profil');
?>
" class="btn btn-default btn-flat"><?php 
echo langGet("menu", "menu_profile");
?>
</a>
                    </div>
                    <div class="pull-right">
                      <a href="<?php 
echo base_url(routeGet('logout'));
?>
" class="btn btn-default btn-flat"><?php 
echo langGet("menu", "menu_logout");
?>
</a>
                    </div>
                  </li>
                </ul>
              </li>
              <li>
                <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
              </li>
            </ul>
          </div>
        </nav>
コード例 #10
0
ファイル: widgetview.php プロジェクト: urangawak/minangcms
$title = menuInfoJSON($widgetID, 'title');
$limit = menuInfoJSON($widgetID, 'limit');
if (!empty($title)) {
    $titleBox = $title;
} else {
    $titleBox = "Recent Post";
}
?>
<div class="widget widget-info">
<div class="widget-header">
	<h3 class="widget-title"><?php 
echo $titleBox;
?>
</h3>
	<div class="widget-tools pull-right"><a href="<?php 
echo base_url(routeGet('postall', 'route_key'));
?>
">+ indexs</a></div>
</div>
<div class="widget-body">
<?php 
$para = array('post_type' => 'post');
$g = mc_allpost($para, "post_date DESC", "", $limit);
if ($g['jumlah'] > 0) {
    foreach ($g['data'] as $row) {
        $postid = $row->post_id;
        $url = permalinkPost($postid);
        $img = mc_imagepost($postid);
        $title = stringWordLimit($row->post_title, 10);
        $desc = stringWordLimit($row->post_content, 20);
        $count = mc_countPostInfo($postid, 'comment');
コード例 #11
0
 function checkAccess()
 {
     $CI =& get_instance();
     $CI->load->helper(array('db_helper', 'url'));
     $ses = roleUser();
     if (empty($ses)) {
         redirect(base_url(routeGet('logout')), 'refresh');
     }
 }