Beispiel #1
0
 public function beforeAction($matches, $callback)
 {
     if ($callback['name'] == 'login') {
         return;
     }
     if ($this->auth === null) {
         @session_start();
         FW::set('auth', $this->auth = isset($_SESSION['member']));
     }
     if (!$this->auth) {
         header('Location: ' . FW::baseUrl() . '/index.php/member/signin');
         return false;
     }
 }
Beispiel #2
0
<?php

FW::set('title', 'Contact - ');
?>
<h1>FW Sample App - Contact</h1>

<form method="post">
  <label for="name">Name</label><br/>
  <input type="text" name="name" id="name" /><br/>
  <br/>
  <label for="message">Message</label><br/>
  <textarea name="message" id="message"></textarea>
  <br/>
  <input type="submit" />
</form>
Beispiel #3
0
<?php

FW::set('title', 'Home - ');
?>
<h1>FW Sample App</h1>

<p><strong>About</strong></p>
Beispiel #4
0
<?php

FW::set('title', 'Not Found - ');
?>
<h1>Not Found</h1>
Beispiel #5
0
<?php

FW::set('title', 'Login - ');
?>
<h1>FW Sample App - Member Area</h1>

<form method="post">
  <?php 
if ($error) {
    ?>
  <div class="error">Login error.</div>
  <?php 
}
?>
  <label for="name">Login</label><br/>
  <input type="text" name="login" id="login" /><small> (Login: sample)</small><br/>
  <br/>
  <label for="message">Password</label><br/>
  <input type="password" name="password" id="password" /><small> (Password: sample)</small><br/>
  <br/>
  <input type="submit" />
</form>