public function index()
 {
     $name = 'BaconBao';
     /*!!!----- Require "Example_model.php" -----!!!*/
     $exampleModel = new Example_model();
     $callback = $exampleModel->example_Text($name);
     /*!!!----- Session Examples -----!!!*/
     $userId = time();
     $loginTimes = 0;
     if (Session::isLogin()) {
         $userId = Session::get('userid');
         $loginTimes = Session::get('counter');
         $counter = (int) $loginTimes + 1;
         Session::set('counter', $counter);
     } else {
         Session::init();
         Session::set('userid', $userId);
         Session::set('counter', (int) $loginTimes + 1);
     }
     require_once VIEWS_PATH . '/home.php';
 }
Beispiel #2
0
	(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
	LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
	ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
	SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

	The views and conclusions contained in the software and documentation are those
	of the authors and should not be interpreted as representing official policies,
	either expressed or implied, of the NAS4Free Project.
*/
/* NAS4FREE CODE */
require "/usr/local/www/guiconfig.inc";
require_once "session.inc";
Session::start();
// Check if session is valid
if (!Session::isLogin()) {
    header('Location: /login.php');
    exit;
}
//------------------------------------------------------------------------------
function gentitle($title)
{
    $navlevelsep = "|";
    // Navigation level separator string.
    return join($navlevelsep, $title);
}
function genhtmltitle($title)
{
    return system_get_hostname() . " - " . gentitle($title);
}
// Menu items.
Beispiel #3
0
 public function __construct()
 {
     if (Session::isLogin()) {
         Response::setRedirect('/');
     }
 }