This file contains 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
<h1> | |
LOGIN REQUIRED | |
</h1> | |
<form method="post" action="/auth/login"> | |
<p> | |
<label for="username">Username</label> | |
<input type="text" name="username" value="${c.username}" /> | |
</p> | |
<p> | |
<label for="password">Password</label> |
This file contains 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
<h1> | |
You are logged in | |
</h1> | |
<p> | |
<strong>Session:</strong> | |
${str(c.user)} | |
</p> | |
<ul> | |
<li> | |
<a href="/root/admin"> |
This file contains 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
import logging | |
from pylons import config, request, response, session, tmpl_context as c | |
from pylons.controllers.util import abort, redirect_to, url_for | |
from pylons_openid.lib.base import BaseController, render | |
log = logging.getLogger(__name__) | |
import urllib2 | |
import md5 | |
import simplejson as json_ |
This file contains 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
__all__ = ["get_id", "require_login", "require_admin", "require_customer"] | |
from pylons.controllers.util import abort, redirect_to, url_for | |
from pylons import session | |
from decorator import decorator | |
_group_admin = ['admin'] | |
_group_customer = ['admin','customer'] | |
def get_id(): |
This file contains 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
from sqlalchemy.orm import * | |
from sqlalchemy import Table, Column, ForeignKey, Integer | |
from sqlalchemy.types import Integer, Unicode, String, DateTime | |
from pylons_openid.model import meta | |
def init_model(engine): | |
"""Call me before using any of the tables or classes in the model""" | |
meta.Session.configure(bind=engine) | |
meta.engine = engine |
This file contains 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
/** | |
* Provides a drop down field with multiple checkboxes | |
* @author Tony Landis http://www.tonylandis.com/ | |
* @copyright Free for all use and modification. The author and copyright must be remain intact here. | |
* | |
* @class Ext.form.MultiSelectField | |
* @extends Ext.form.TriggerField | |
*/ | |
Ext.form.MultiSelectField = Ext.extend(Ext.form.TriggerField, { | |
triggerClass: 'x-form-trigger', |
This file contains 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 | |
require "../includes/smarty/Smarty.class.php"; | |
$smarty = new Smarty; | |
$smarty->template_dir = 'templates'; | |
$smarty->compile_dir = 'compile'; | |
$smarty->cache_dir = '/var/www/site/tmp'; | |
$smarty->caching = true; | |
$smarty->force_compile = true; |
This file contains 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
cache_path = "/var/www/site/tmp" | |
cache_code = "compile" | |
-- render and cache to the filesystem | |
function cache_gen() | |
lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. "/index.php" | |
lighty.env["uri.query"] = "p=" .. string.gsub(lighty.env["uri.path"], "\.(htm|html)$", "") | |
--print ("CACHE: " .. lighty.env["uri.query"]) | |
end | |
This file contains 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
<!-- | |
AgileGallery Source Code | |
Author: Tony Landis | |
Link: http://www.agilegallery.com | |
Link: http://www.tonylandis.com | |
License: GPL | |
Restrictions: Free for personal/commerical use, the link/credit must remain intact and visible | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> |
This file contains 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 | |
#Quick and dirty PDO vs ADOdb benchmark | |
#PDO benchmark script: | |
$db = new PDO("mysql:dbname=logs;host=127.0.0.1", "root", ""); | |
$rs = $db->query("select * from ses limit 10")->fetchAll(PDO::FETCH_ASSOC); | |
foreach($rs as $r) {} | |
#ADOdb benchmark script |