This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| application: getting-started | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| handlers: | |
| - url: /.* | |
| script: main.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print 'Hello, World!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Search</title> | |
| </head> | |
| <body> | |
| <form method="get" action="."> | |
| <p><input type="text" name="q" /> | |
| <input type="submit" value="Search" /></p> | |
| </form> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Search</title> | |
| </head> | |
| <body> | |
| {% if errors %} | |
| <ul> | |
| {% for error in errors %} | |
| <li>{{ error }}</li> | |
| {% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (!defined('BASEPATH')) exit('No direct script access allowed.'); | |
| class Articles extends Controller { | |
| function Articles() { | |
| parent::Controller(); | |
| } | |
| function edit($id = NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE IF NOT EXISTS `accounts` ( | |
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
| `email` varchar(120) NOT NULL, | |
| `password_hash` varchar(40) NOT NULL, | |
| `salt` varchar(7) NOT NULL, | |
| `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | |
| `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| PRIMARY KEY (`id`), | |
| UNIQUE KEY `email` (`email`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE IF NOT EXISTS `accounts` ( | |
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
| `username` varchar(20) NOT NULL, | |
| `password_hash` varchar(40) NOT NULL, | |
| `salt` varchar(7) NOT NULL, | |
| `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | |
| `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| PRIMARY KEY (`id`), | |
| UNIQUE KEY `email` (`email`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // create() | |
| // Creates a user | |
| function create() { | |
| if ($this->erkana_auth->create_account('email')) { | |
| redirect('accounts'); | |
| } | |
| $this->load->view('accounts/create'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // index() | |
| // Displays the login screen | |
| function index() { | |
| if ($this->erkana_auth->validate_login('email')) { | |
| redirect('announcements'); | |
| } | |
| $this->load->view('accounts/index'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if (!defined('BASEPATH')) exit('No direct script access allowed.'); | |
| class Announcements extends Controller { | |
| function Announcements() { | |
| parent::Controller(); | |
| } | |
| // index() |