зеркало из https://github.com/mozilla/pjs.git
More work from Ryan Flint <rflint@dslr.net> on the Party Tool
This commit is contained in:
Родитель
bf8988336f
Коммит
3b03c8e3ec
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
/* You should specify a Google Map API key here. Without it, all mapping features
|
||||
* will be disabled. To obtain a key, visit http://www.google.com/apis/maps/
|
||||
*/
|
||||
define('GMAP_API_KEY', '');
|
||||
|
||||
/* The search API key is used to generate spelling suggestions for locations not
|
||||
* not found during a Geocode operation. You may obtain a key here: http://www.google.com/apis/
|
||||
*/
|
||||
define('GSEARCH_API_KEY', '');
|
||||
|
||||
define('MAX_YEAR', 2007);
|
||||
define('APP_NAME', 'Firefox Party');
|
||||
define('APP_EMAIL', '');
|
||||
|
||||
/* The Flickr API is used to show photos of each party on the individual party
|
||||
* pages and home page. See http://flickr.com/services/api/keys/ to obtain a key
|
||||
*/
|
||||
define('FLICKR_API_KEY', '');
|
||||
/* The tag prefix is used to limit the results returned to a specific party.
|
||||
* e.g. any photo tagged with FirefoxParty11 will be shown on party 11's page.
|
||||
* Photos tagged with only the prefix are shown on the front page (so choose wisely! ;) ).
|
||||
*/
|
||||
define('FLICKR_TAG_PREFIX', '');
|
||||
?>
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
class DATABASE_CONFIG {
|
||||
var $default = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
|
|
|
@ -13,6 +13,7 @@ CREATE TABLE IF NOT EXISTS `parties` (
|
|||
`name` tinytext NOT NULL,
|
||||
`vname` tinytext,
|
||||
`address` tinytext NOT NULL,
|
||||
`tz` int(2) NOT NULL default '0',
|
||||
`website` tinytext,
|
||||
`notes` text,
|
||||
`date` int(10) default NULL,
|
||||
|
@ -20,9 +21,10 @@ CREATE TABLE IF NOT EXISTS `parties` (
|
|||
`guests` tinytext NOT NULL,
|
||||
`confirmed` tinyint(1) NOT NULL default '0',
|
||||
`inviteonly` tinyint(1) NOT NULL default '0',
|
||||
`invitecode` tinytext NOT NULL,
|
||||
`lat` float default NULL,
|
||||
`long` float default NULL,
|
||||
`zoom` int(5) default NULL,
|
||||
`zoom` tinyint(2) NOT NULL default '8',
|
||||
`useflickr` tinyint(1) NOT NULL default '0',
|
||||
`flickrid` tinytext NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
|
@ -37,6 +39,7 @@ CREATE TABLE IF NOT EXISTS `users` (
|
|||
`salt` varchar(9) NOT NULL default '',
|
||||
`name` tinytext NOT NULL,
|
||||
`location` tinytext NOT NULL,
|
||||
`tz` int(2) NOT NULL default '0',
|
||||
`website` tinytext NOT NULL,
|
||||
`lat` float default NULL,
|
||||
`long` float default NULL,
|
||||
|
|
|
@ -57,7 +57,7 @@ class CommentController extends AppController {
|
|||
$this->data['Comment']['text'] = preg_replace('/\n/', '<br/>', $text);
|
||||
$this->data['Comment']['owner'] = $uid;
|
||||
$this->data['Comment']['assoc'] = $pid;
|
||||
$this->data['Comment']['time'] = time();
|
||||
$this->data['Comment']['time'] = gmmktime();
|
||||
|
||||
if ($this->Comment->save($this->data)) {
|
||||
$this->redirect('/party/view/'.$pid);
|
||||
|
|
|
@ -36,8 +36,10 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
class PagesController extends AppController {
|
||||
var $name = 'Pages';
|
||||
var $pageTitle;
|
||||
|
||||
function display() {
|
||||
$this->pageTitle = APP_NAME." - Home";
|
||||
$this->set('pcount', $this->Page->findCount());
|
||||
$this->set('ucount', $this->Page->getUsers());
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Firefox Party Tool
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
|
@ -35,46 +35,70 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
vendor('webServices');
|
||||
vendor('mail');
|
||||
uses('sanitize');
|
||||
class PartyController extends AppController {
|
||||
var $name = 'Party';
|
||||
var $pageTitle;
|
||||
var $components = array('RequestHandler');
|
||||
var $components = array('Security');
|
||||
|
||||
|
||||
function beforeFilter() {
|
||||
$this->Security->requirePost('rsvp','unrsvp');
|
||||
$this->Security->requirePost('unrsvp');
|
||||
}
|
||||
|
||||
|
||||
function index() {
|
||||
if (GMAP_API_KEY != null)
|
||||
$this->set('body_args', ' onload="initMashUp()" onunload="GUnload()"');
|
||||
$this->pageTitle = APP_NAME." - Party Map";
|
||||
}
|
||||
|
||||
|
||||
function register() {
|
||||
if (!$this->Session->check('User')) {
|
||||
$this->redirect('/user');
|
||||
}
|
||||
|
||||
|
||||
$this->pageTitle = APP_NAME." - Register";
|
||||
|
||||
$this->set('error', false);
|
||||
if (GMAP_API_KEY != null)
|
||||
$this->set('body_args', ' onload="mapInit(14.944785, -156.796875, 1)" onunload="GUnload()"');
|
||||
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$clean = new Sanitize();
|
||||
$temp = array('lat' => $clean->sql($this->data['Party']['lat']),
|
||||
'long' => $clean->sql($this->data['Party']['long']),
|
||||
'tz' => $clean->sql($this->data['Party']['tz']));
|
||||
|
||||
$clean->cleanArray($this->data);
|
||||
|
||||
$this->data['Party']['date'] = mktime($this->data['Party']['hour_hour'],
|
||||
$this->data['Party']['minute_min'],
|
||||
0,
|
||||
$this->data['Party']['month_hour'],
|
||||
$this->data['Party']['day_day'],
|
||||
$this->data['Party']['year_year']);
|
||||
|
||||
|
||||
$this->data['Party']['lat'] = floatval($temp['lat']);
|
||||
$this->data['Party']['long'] = floatval($temp['long']);
|
||||
$this->data['Party']['tz'] = intval($temp['tz']);
|
||||
|
||||
$secoffset = ($this->data['Party']['tz'] * 60 * 60);
|
||||
|
||||
$offsetdate = gmmktime($this->data['Party']['hour_hour'],
|
||||
$this->data['Party']['minute_min'],
|
||||
0,
|
||||
$this->data['Party']['month_hour'],
|
||||
$this->data['Party']['day_day'],
|
||||
$this->data['Party']['year_year']);
|
||||
|
||||
$this->data['Party']['date'] = ($offsetdate + $secoffset);
|
||||
$this->data['Party']['owner'] = $_SESSION['User']['id'];
|
||||
|
||||
$key = null;
|
||||
$chars = "1234567890abcdefghijklmnopqrstuvwxyz";
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$key .= $chars{rand(0,35)};
|
||||
}
|
||||
|
||||
$this->data['Party']['invitecode'] = $key;
|
||||
|
||||
if (empty($this->data['Party']['lat']) && !empty($this->data['Party']['address']) &&
|
||||
$this->data['Party']['geocoded'] == 0) {
|
||||
|
||||
|
||||
// Attempt to geocode the address again
|
||||
$geocoder = new webServices(array('type' => 'geocode'));
|
||||
if ($ll = $geocoder->geocode($this->data['Party']['address']) != 0) {
|
||||
|
@ -84,6 +108,7 @@ class PartyController extends AppController {
|
|||
else {
|
||||
// May not come back with exactly what the user was looking for, but they can always edit
|
||||
$suggest = new webServices(array('type' => 'gsuggest'));
|
||||
$geocoder = new webServices(array('type' => 'geocode'));
|
||||
if ($suggestion = $suggest->GSuggest($this->data['Party']['address']) != 0) {
|
||||
$this->data['Party']['address'] = $suggestion;
|
||||
if ($ll = $geocoder->geocode($suggestion) != 0) {
|
||||
|
@ -93,30 +118,101 @@ class PartyController extends AppController {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->Party->save($this->data))
|
||||
$this->redirect('party/view/'.$this->Party->getInsertId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function edit($id = null) {
|
||||
$this->Party->id = $id;
|
||||
$party = $this->Party->read();
|
||||
$this->set('party', $party);
|
||||
$this->pageTitle = APP_NAME." - Edit Party";
|
||||
|
||||
if (empty($_SESSION['User']['id']))
|
||||
$this->redirect('/user/login/');
|
||||
|
||||
if ($party['Party']['owner'] != $_SESSION['User']['id'])
|
||||
$this->redirect('/party/view/'.$id);
|
||||
|
||||
else {
|
||||
if (empty($this->data)) {
|
||||
$this->data = $party;
|
||||
|
||||
$this->data['Party']['hour_hour'] = intval(date('h', $party['Party']['date']));
|
||||
$this->data['Party']['minute_min'] = intval(date('i', $party['Party']['date']));
|
||||
$this->data['Party']['month_hour'] = intval(date('m', $party['Party']['date']));
|
||||
$this->data['Party']['day_day'] = intval(date('d', $party['Party']['date']));
|
||||
$this->data['Party']['year_year'] = intval(date('Y', $party['Party']['date']));
|
||||
|
||||
if (GMAP_API_KEY != null) {
|
||||
if ($this->data['Party']['lat'])
|
||||
$this->set('body_args',
|
||||
' onload="mapInit('.$this->data["Party"]["lat"].', '.$this->data["Party"]["long"].', '.$this->data["Party"]["zoom"].');" onunload="GUnload()"');
|
||||
else
|
||||
$this->set('body_args',
|
||||
' onload="mapInit(1, 1, 1);" onunload="GUnload()"');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$clean = new Sanitize();
|
||||
$temp = array('lat' => $clean->sql($this->data['Party']['lat']),
|
||||
'long' => $clean->sql($this->data['Party']['long']),
|
||||
'tz' => $clean->sql($this->data['Party']['tz']));
|
||||
|
||||
$clean->cleanArray($this->data);
|
||||
|
||||
$this->data['Party']['lat'] = floatval($temp['lat']);
|
||||
$this->data['Party']['long'] = floatval($temp['long']);
|
||||
$this->data['Party']['tz'] = intval($temp['tz']);
|
||||
|
||||
$secoffset = ($this->data['Party']['tz'] * 60 * 60);
|
||||
|
||||
$offsetdate = gmmktime($this->data['Party']['hour_hour'],
|
||||
$this->data['Party']['minute_min'],
|
||||
0,
|
||||
$this->data['Party']['month_hour'],
|
||||
$this->data['Party']['day_day'],
|
||||
$this->data['Party']['year_year']);
|
||||
|
||||
$this->data['Party']['date'] = ($offsetdate - $secoffset);
|
||||
$this->data['Party']['owner'] = $_SESSION['User']['id'];
|
||||
|
||||
if (!empty($this->data['Party']['flickrusr'])) {
|
||||
$params = array('type' => 'flickr', 'userid' => $this->data['Party']['flickrusr']);
|
||||
$flick = new webServices($params);
|
||||
$this->data['Party']['flickrid'] = $flick->getFlickrId();
|
||||
}
|
||||
|
||||
if ($this->Party->save($this->data))
|
||||
$this->redirect('party/view/'.$id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function view($id = null, $page = null) {
|
||||
if ($id == "all") {
|
||||
$this->pageTitle = APP_NAME." - All Parties";
|
||||
$count = $this->Party->findCount();
|
||||
$pages = ceil($count/10);
|
||||
if ($page == null)
|
||||
$page = 1;
|
||||
|
||||
|
||||
if ($page > 1)
|
||||
$this->set('prev', $page - 1);
|
||||
if ($page < $pages)
|
||||
$this->set('next', $page + 1);
|
||||
|
||||
|
||||
$this->set('parties', $this->Party->findAll(null, null, "name ASC", 10, $page));
|
||||
}
|
||||
|
||||
|
||||
else if (is_numeric($id)) {
|
||||
$party = $this->Party->findById($id);
|
||||
$this->set('party', $party);
|
||||
|
||||
$this->pageTitle = APP_NAME." - ".$party['Party']['name'];
|
||||
|
||||
if ($party['Party']['useflickr'] == 1) {
|
||||
$data = array('type' => 'flickr', 'userid' => $party['Party']['flickrid']);
|
||||
|
@ -126,39 +222,51 @@ class PartyController extends AppController {
|
|||
if (!empty($party['Party']['guests'])) {
|
||||
$guests = explode(',', $party['Party']['guests']);
|
||||
$names = array();
|
||||
|
||||
|
||||
for ($i = 0; $i < count($guests); $i++)
|
||||
array_push($names, $this->Party->getUserName($guests[$i]));
|
||||
|
||||
|
||||
$this->set('guests', $guests);
|
||||
$this->set('names', $names);
|
||||
}
|
||||
|
||||
|
||||
$this->set('host', $this->Party->getUserName($party['Party']['owner']));
|
||||
$this->set('comments', $this->Party->getComments($party['Party']['id']));
|
||||
$this->set('comments', $this->Party->getComments($party['Party']['id']));
|
||||
$this->set('body_args', ' onload="mapInit('.$party['Party']['lat'].', '.$party['Party']['long'].', '.$party['Party']['zoom'].', \'stationary\')" onunload="GUnload()"');
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
$this->redirect('/party/view/all');
|
||||
}
|
||||
}
|
||||
|
||||
function rsvp($aParty = null) {
|
||||
function rsvp($aParty = null, $icode = null) {
|
||||
if (!is_numeric($aParty))
|
||||
$this->redirect('/');
|
||||
|
||||
$party = $this->Party->findById($aParty);
|
||||
$invited = false;
|
||||
|
||||
if ($icode != null) {
|
||||
$party = $this->Party->findByInvitecode($icode);
|
||||
if ($aParty != $party['Party']['id'])
|
||||
$this->redirect('/party/view/'.$aParty);
|
||||
else
|
||||
$invited = true;
|
||||
}
|
||||
|
||||
else
|
||||
$party = $this->Party->findById($aParty);
|
||||
|
||||
$user = $this->Session->read('User');
|
||||
if (empty($user['id']))
|
||||
if (empty($_SESSION['User']['id']))
|
||||
$this->redirect('/user/login');
|
||||
|
||||
else {
|
||||
else if ($party['Party']['inviteonly'] != 1 || $invited === true) {
|
||||
if (empty($party['Party']['guests'])) {
|
||||
$this->data['Party']['guests'] = $user['id'];
|
||||
$this->data['Party']['id'] = $aParty;
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
$attendees = explode(',', $party['Party']['guests']);
|
||||
if (in_array($user['id'], $attendees))
|
||||
|
@ -170,10 +278,13 @@ class PartyController extends AppController {
|
|||
$this->data['Party']['guests'] = $csv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($this->Party->save($this->data))
|
||||
$this->redirect('/party/view/'.$aParty.'/added');
|
||||
}
|
||||
|
||||
else
|
||||
$this->redirect('/party/view/'.$aParty);
|
||||
}
|
||||
|
||||
function unrsvp($aParty) {
|
||||
|
@ -181,7 +292,7 @@ class PartyController extends AppController {
|
|||
if (empty($user)) {
|
||||
$this->redirect('/user/login');
|
||||
}
|
||||
|
||||
|
||||
if (is_numeric($aParty)) {
|
||||
$party = $this->Party->findById($aParty);
|
||||
$temp = explode(',', $party['Party']['guests']);
|
||||
|
@ -199,9 +310,39 @@ class PartyController extends AppController {
|
|||
else
|
||||
$this->redirect('/');
|
||||
}
|
||||
|
||||
function invite() {
|
||||
//XXX TODO
|
||||
|
||||
function invite($id = null) {
|
||||
$this->pageTitle = APP_NAME." - Invite a guest";
|
||||
if (is_numeric($id) && isset($_SESSION['User'])) {
|
||||
$party = $this->Party->findById($id);
|
||||
if ($party['Party']['owner'] === $_SESSION['User']['id']) {
|
||||
$this->set('partyid', $party['Party']['id']);
|
||||
$this->set('inviteurl', APP_BASE.'/register/'.$party['Party']['invitecode']);
|
||||
|
||||
if (!empty($this->data)) {
|
||||
if ($this->Party->validates($this->data)) {
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $this->data['Party']['einvite'],
|
||||
'subject' => 'You\'ve been invited to '.APP_NAME.'!',
|
||||
'link' => APP_BASE.'/user/register/'.$party['Party']['invitecode'],
|
||||
'type' => 'invite');
|
||||
|
||||
$mail = new mail($message);
|
||||
$mail->send();
|
||||
$this->set('preamble', array($this->data['Party']['einvite'], $id));
|
||||
}
|
||||
else {
|
||||
$this->validateErrors($this->Party);
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->redirect('/party/view/'.$id);
|
||||
}
|
||||
else
|
||||
$this->redirect('/user/login');
|
||||
}
|
||||
|
||||
function js() {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Firefox Party Tool
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
|
@ -39,72 +39,115 @@ uses('sanitize');
|
|||
class UserController extends AppController {
|
||||
var $name = 'User';
|
||||
var $helpers = array('Html');
|
||||
|
||||
var $pageTitle;
|
||||
|
||||
function index() {
|
||||
if (!$this->Session->check('User')) {
|
||||
if (!isset($_SESSION['User'])) {
|
||||
$this->redirect('/user/login');
|
||||
}
|
||||
|
||||
$this->pageTitle = APP_NAME." - My Profile";
|
||||
|
||||
$user = $this->Session->read('User');
|
||||
$this->set('parties', $this->User->memberOf($user['id']));
|
||||
$this->set('hparties', $this->User->hostOf($user['id']));
|
||||
}
|
||||
|
||||
|
||||
function edit() {
|
||||
if (!isset($_SESSION['User'])) {
|
||||
$this->redirect('/user/login');
|
||||
}
|
||||
$this->set('error', false);
|
||||
$user = $this->User->findById($_SESSION['User']['id']);
|
||||
$this->set('user', $user);
|
||||
if (GMAP_API_KEY != null && !empty($user['User']['lat']))
|
||||
$this->pageTitle = APP_NAME." - Edit My Account";
|
||||
if (empty($this->data)) {
|
||||
$this->User->id = $_SESSION['User']['id'];
|
||||
$this->data = $this->User->read();
|
||||
$this->data['User']['password'] = "";
|
||||
|
||||
if (GMAP_API_KEY != null && !empty($this->data['User']['lat']))
|
||||
$this->set('body_args',
|
||||
' onload="mapInit('.$user["User"]["lat"].', '.$user["User"]["long"].', '.$user["User"]["zoom"].');" onunload="GUnload()"');
|
||||
|
||||
if (!empty($this->data)) {
|
||||
//XXX TODO
|
||||
$this->redirect('/user/');
|
||||
' onload="mapInit('.$this->data["User"]["lat"].', '.$this->data["User"]["long"].', '.$this->data["User"]["zoom"].');" onunload="GUnload()"');
|
||||
}
|
||||
|
||||
else {
|
||||
$user = $this->User->findById($_SESSION['User']['id']);
|
||||
$this->User->id = $user['User']['id'];
|
||||
|
||||
|
||||
if (!empty($this->data['User']['password'])) {
|
||||
if ($this->data['User']['password'] === $this->data['User']['confpassword']) {
|
||||
$string = $user['User']['email'].uniqid(rand(), true).$this->data['User']['password'];
|
||||
$this->data['User']['salt'] = substr(md5($string), 0, 9);
|
||||
$this->data['User']['password'] = sha1($this->data['User']['password'] . $this->data['User']['salt']);
|
||||
}
|
||||
else {
|
||||
$this->set('error', true);
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->data['User']['password'] = $user['User']['password'];
|
||||
|
||||
|
||||
if ($this->User->save($this->data)) {
|
||||
$this->redirect('/user/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function view($aUid = null) {
|
||||
if ($aUid === null || !is_numeric($aUid))
|
||||
$this->redirect('/');
|
||||
|
||||
|
||||
else {
|
||||
$user = $this->User->findById($aUid);
|
||||
$this->pageTitle = APP_NAME." - ".$user['User']['name'];
|
||||
$this->set('user', $user);
|
||||
if (GMAP_API_KEY != null && !empty($user['User']['lat']))
|
||||
$this->set('body_args',
|
||||
' onload="mapInit('.$user["User"]["lat"].', '.$user["User"]["long"].', '.$user["User"]["zoom"].', \'stationary\');" onunload="GUnload()"');
|
||||
$parties = $this->User->memberOf($user['User']['id']);
|
||||
$this->set('parties', $parties);
|
||||
$this->set('hparties', $this->User->hostOf($user['User']['id']));
|
||||
}
|
||||
}
|
||||
|
||||
function register() {
|
||||
|
||||
function register($invite = null) {
|
||||
$this->set('error', false);
|
||||
if ($this->Session->check('User')) {
|
||||
$this->redirect('/user/');
|
||||
if (isset($_SESSION['User'])) {
|
||||
if ($invite != null) {
|
||||
$this->redirect('/party/rsvp/'.$this->User->getPartyId($invite).'/'.$invite);
|
||||
}
|
||||
else
|
||||
$this->redirect('/user/');
|
||||
}
|
||||
|
||||
if (empty($this->data))
|
||||
$this->set('icode', $invite);
|
||||
|
||||
$this->pageTitle = APP_NAME." - Register";
|
||||
if (GMAP_API_KEY != null)
|
||||
$this->set('body_args', ' onload="mapInit()" onunload="GUnload()"');
|
||||
|
||||
if (!empty($this->data)) {
|
||||
|
||||
$clean = new Sanitize();
|
||||
$temp = array('email' => $this->data['User']['email'],
|
||||
'password' => $this->data['User']['password'],
|
||||
'confpassword' => $this->data['User']['confpassword'],
|
||||
'lat' => $clean->sql($this->data['User']['lat']),
|
||||
'long' => $clean->sql($this->data['User']['long']));
|
||||
'long' => $clean->sql($this->data['User']['long']),
|
||||
'tz' => $clean->sql($this->data['User']['tz']));
|
||||
//Nuke everything else
|
||||
$clean->cleanArray($this->data);
|
||||
|
||||
$this->data['User']['email'] = $temp['email'];
|
||||
$this->data['User']['password'] = $temp['password'];
|
||||
$this->data['User']['confpassword'] = $temp['confpassword'];
|
||||
$this->data['User']['lat'] = $temp['lat'];
|
||||
$this->data['User']['long'] = $temp['long'];
|
||||
$this->data['User']['lat'] = floatval($temp['lat']);
|
||||
$this->data['User']['long'] = floatval($temp['long']);
|
||||
$this->data['User']['role'] = 0;
|
||||
|
||||
$this->data['User']['tz'] = intval($temp['tz']);
|
||||
|
||||
if (!$this->User->findByEmail($this->data['User']['email'])) {
|
||||
if ($this->data['User']['password'] === $this->data['User']['confpassword']) {
|
||||
if ($this->User->validates($this->data)) {
|
||||
|
@ -117,23 +160,28 @@ class UserController extends AppController {
|
|||
for ($i = 0; $i < 10; $i++) {
|
||||
$key .= $chars{rand(0,35)};
|
||||
}
|
||||
|
||||
|
||||
$this->data['User']['active'] = $key;
|
||||
|
||||
if ($this->User->save($this->data)) {
|
||||
$message = array(
|
||||
'from' => 'Firefox Party <noreply@screwedbydesign.com>',
|
||||
'envelope' => 'noreply@screwedbydesign.com',
|
||||
'from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $this->data['User']['email'],
|
||||
'subject' => 'Your Firefox Party Registration',
|
||||
'message' => "You're almost ready to party! Just go to http://screwedbydesign.com/cake/user/activate/".$key." to activate your account.");
|
||||
|
||||
'subject' => 'Your '.APP_NAME.' Registration',
|
||||
'link' => APP_BASE.'/user/activate/'.$key,
|
||||
'type' => 'act');
|
||||
|
||||
$mail = new mail($message);
|
||||
$mail->send();
|
||||
|
||||
|
||||
if (!empty($this->data['User']['icode']))
|
||||
$this->User->addToParty($this->data['User']['icode'], $this->User->getLastInsertID());
|
||||
|
||||
$this->redirect('/user/login/new');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
$this->validateErrors($this->User);
|
||||
$this->render();
|
||||
|
@ -157,7 +205,7 @@ class UserController extends AppController {
|
|||
function activate($aKey = null) {
|
||||
if ($aKey == null)
|
||||
$this->redirect('/');
|
||||
|
||||
|
||||
else {
|
||||
$this->data = $this->User->findByActive($aKey);
|
||||
$this->data['User']['active'] = 1;
|
||||
|
@ -167,28 +215,29 @@ class UserController extends AppController {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function login($isNew = null) {
|
||||
if ($this->Session->check('User')) {
|
||||
if (isset($_SESSION['User'])) {
|
||||
$this->redirect('/user/');
|
||||
}
|
||||
|
||||
|
||||
$this->pageTitle = APP_NAME." - Login";
|
||||
$this->set('error', false);
|
||||
|
||||
|
||||
if ($isNew !== null) {
|
||||
switch($isNew) {
|
||||
case "new":
|
||||
$this->set('preamble', 'Thank you for registering! To login, you\'ll need to activate your account. Please check your email for your activation link.');
|
||||
break;
|
||||
|
||||
|
||||
case "rnew":
|
||||
$this->set('preamble', 'An email with instructions on how to reset your password has been sent.');
|
||||
break;
|
||||
|
||||
|
||||
case "active":
|
||||
$this->set('preamble', 'Your account has been activated. You may now login.');
|
||||
break;
|
||||
|
||||
|
||||
case "reset":
|
||||
$this->set('preamble', 'Your password has been reset.');
|
||||
break;
|
||||
|
@ -198,7 +247,7 @@ class UserController extends AppController {
|
|||
|
||||
if (!empty($this->data)) {
|
||||
$user = $this->User->findByEmail($this->data['User']['email']);
|
||||
|
||||
|
||||
if ($user['User']['active'] != 1) {
|
||||
$this->set('preamble', 'Your account hasn\'t been activated yet.
|
||||
Please check your email (including junk/spam folders) for your
|
||||
|
@ -206,26 +255,27 @@ class UserController extends AppController {
|
|||
to resend your activation details.');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
if ($user['User']['active'] == 1 && $user['User']['password'] == sha1($this->data['User']['password'] . $user['User']['salt'])) {
|
||||
$this->Session->write('User', $user['User']);
|
||||
$this->redirect('/user/');
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
$this->set('error', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function logout() {
|
||||
$this->Session->delete('User');
|
||||
$this->redirect('/');
|
||||
}
|
||||
|
||||
|
||||
function recover($aType = null, $aCode = null, $aId = null) {
|
||||
switch ($aType) {
|
||||
case "password":
|
||||
$this->pageTitle = APP_NAME." - Password Recovery";
|
||||
$this->set('hideInput', false);
|
||||
$this->set('url', 'password');
|
||||
if (!empty($this->data)) {
|
||||
|
@ -237,34 +287,35 @@ class UserController extends AppController {
|
|||
}
|
||||
else {
|
||||
$code = md5($user['User']['salt'].$user['User']['email'].$user['User']['password']);
|
||||
$message = array('from' => APP_NAME.'<'.APP_EMAIL.'>',
|
||||
$message = array('from' => APP_NAME.'<'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $user['User']['email'],
|
||||
'subject' => APP_NAME.' Password Request',
|
||||
'message' => "Just go to http://screwedbydesign.com/cake/user/recover/password/".$code."/".$user['User']['id']." to reset your password.");
|
||||
|
||||
'link' => APP_BASE.'/user/recover/password/'.$code.'/'.$user['User']['id'],
|
||||
'type' => 'prec');
|
||||
|
||||
$mail = new mail($message);
|
||||
$mail->send();
|
||||
$this->redirect('user/login/rnew');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($aCode !== null && $aId !== null) {
|
||||
$this->set('hideInput', true);
|
||||
$this->set('reset', false);
|
||||
$user = $this->User->findById($aId);
|
||||
|
||||
|
||||
if (!$user) {
|
||||
$this->set('error', 'Invalid request. Please check the URL and try again.');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
if ($aCode == md5($user['User']['salt'].$user['User']['email'].$user['User']['password'])) {
|
||||
$this->set('reset', true);
|
||||
$this->set('code', $aCode."/".$aId);
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
else {
|
||||
$this->set('error', 'Invalid request. Please check the URL and try again.');
|
||||
$this->render();
|
||||
|
@ -272,9 +323,10 @@ class UserController extends AppController {
|
|||
}
|
||||
break;
|
||||
case "activate":
|
||||
$this->pageTitle = APP_NAME." - Resend Activation Code";
|
||||
$this->set('hideInput', false);
|
||||
$this->set('url', 'activate');
|
||||
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$user = $this->User->findByEmail($this->data['User']['email']);
|
||||
|
||||
|
@ -282,17 +334,17 @@ class UserController extends AppController {
|
|||
$this->set('error', 'Could not find a user with that email address. Please check it and try again.');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
if ($user['User']['active'] == 1)
|
||||
$this->redirect('/user/login/active');
|
||||
|
||||
|
||||
else {
|
||||
$message = array('from' => 'Firefox Party <noreply@screwedbydesign.com>',
|
||||
'envelope' => 'noreply@screwedbydesign.com',
|
||||
'to' => $user['User']['email'],
|
||||
'subject' => 'Your Firefox Party Registration',
|
||||
'message' => "You're almost ready to party! Just go to http://screwedbydesign.com/cake/user/activate/".$user['User']['active']." to activate your account.");
|
||||
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $this->data['User']['email'],
|
||||
'subject' => 'Your '.APP_NAME.' Registration',
|
||||
'link' => APP_BASE.'/user/activate/'.$user['User']['active'],
|
||||
'type' => 'act');
|
||||
$mail = new mail($message);
|
||||
$mail->send();
|
||||
$this->redirect('user/login/new');
|
||||
|
@ -307,7 +359,7 @@ class UserController extends AppController {
|
|||
$this->set('error', 'Invalid request. Please check the URL and try again.');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
|
||||
if ($aCode == md5($user['User']['salt'].$user['User']['email'].$user['User']['password'])) {
|
||||
$string = $user['User']['email'] . uniqid(rand(), true) . $this->data['User']['password'];
|
||||
$this->data['User']['salt'] = substr(md5($string), 0, 9);
|
||||
|
@ -323,7 +375,7 @@ class UserController extends AppController {
|
|||
$this->redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function delete($id) {
|
||||
$role = $this->Session->read('User');
|
||||
if ($role['role'] != 2)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Firefox Party Tool
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
|
@ -38,7 +38,8 @@ class Party extends AppModel {
|
|||
var $name = 'Party';
|
||||
|
||||
var $validate = array(
|
||||
'name' => VALID_NOT_EMPTY
|
||||
'name' => VALID_NOT_EMPTY,
|
||||
'einvite' => VALID_EMAIL
|
||||
);
|
||||
|
||||
function getComments($pid) {
|
||||
|
@ -53,7 +54,7 @@ class Party extends AppModel {
|
|||
|
||||
function getUserName($uid) {
|
||||
$rv = $this->query("SELECT name FROM users WHERE id = ".$uid);
|
||||
return $rv[0]['users']['name'];
|
||||
return @$rv[0]['users']['name'];
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -12,7 +12,7 @@
|
|||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Firefox Party Tool
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
|
@ -51,5 +51,31 @@ class User extends AppModel {
|
|||
$parties = $this->query("SELECT id,name FROM parties WHERE owner = ".$uid);
|
||||
return $parties;
|
||||
}
|
||||
|
||||
function getPartyId($icode) {
|
||||
$party = $this->query("SELECT id FROM parties WHERE invitecode = \"".$icode."\"");
|
||||
|
||||
if (!empty($party))
|
||||
return $party[0]['parties']['id'];
|
||||
}
|
||||
|
||||
function addToParty($icode, $uid) {
|
||||
$party = $this->query("SELECT id,guests FROM parties WHERE invitecode = \"".$icode."\"");
|
||||
|
||||
if (!empty($party[0]['parties']['id'])) {
|
||||
$guests = $party[0]['parties']['guests'];
|
||||
|
||||
if (empty($guests)) {
|
||||
$guests = $uid;
|
||||
}
|
||||
else {
|
||||
$temp = explode(',', $guests);
|
||||
array_push($temp, $uid);
|
||||
$guests = implode(',', $temp);
|
||||
}
|
||||
|
||||
$this->query("UPDATE parties SET guests = \"".$guests."\" WHERE id = ".$party[0]['parties']['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,59 +0,0 @@
|
|||
<?php
|
||||
class mail {
|
||||
var $from;
|
||||
var $to;
|
||||
var $subject;
|
||||
var $message;
|
||||
var $envelope;
|
||||
|
||||
/**
|
||||
* Everything coming in via $params should be validated already
|
||||
*/
|
||||
function mail($params) {
|
||||
if (array_key_exists('from', $params)) {
|
||||
$this->from = $params['from'];
|
||||
}
|
||||
if (array_key_exists('to', $params)) {
|
||||
$this->to = $params['to'];
|
||||
}
|
||||
if (array_key_exists('subject', $params)) {
|
||||
$this->subject = $params['subject'];
|
||||
}
|
||||
if (array_key_exists('message', $params)) {
|
||||
$this->message = $params['message'];
|
||||
}
|
||||
if (array_key_exists('envelope', $params)) {
|
||||
$this->envelope = $params['envelope'];
|
||||
}
|
||||
}
|
||||
|
||||
function make_headers($type='html') {
|
||||
$headers = '';
|
||||
|
||||
switch($type) {
|
||||
case 'html':
|
||||
$headers .= 'MIME-Version: 1.0' . "\r\n";
|
||||
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
||||
break;
|
||||
}
|
||||
|
||||
if (!empty($this->from)) {
|
||||
$headers .= "From: {$this->from}\r\n";
|
||||
$headers .= "Reply-To: {$this->from}\r\n";
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
|
||||
function make_additional_parameters() {
|
||||
if (!empty($this->envelope)) {
|
||||
return '-f'.$this->envelope;
|
||||
}
|
||||
}
|
||||
|
||||
function send() {
|
||||
mail($this->to, $this->subject, $this->message, $this->make_headers(), $this->make_additional_parameters());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
|
@ -74,6 +74,10 @@ class webServices {
|
|||
}
|
||||
}
|
||||
|
||||
function getFlickrId() {
|
||||
return $this->userid;
|
||||
}
|
||||
|
||||
function fetchPhotos($tags, $num_results) {
|
||||
$head = "GET /services/rest/?method=flickr.photos.search&api_key=".FLICKR_API_KEY."&user_id=".$this->userid."&tags=".$tags."&per_page=".$num_results." HTTP/1.1\r\n";
|
||||
$head .= "Host: ".$this->host."\r\n";
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<div style="font-size: x-large; font-weight: bold; text-align: center">
|
||||
<?php echo $pcount.(($pcount == 1) ? ' Party, ' : ' Parties, ').$ucount.(($ucount == 1) ? ' Partygoer, ' : ' Partygoers, ');
|
||||
<?php
|
||||
echo $pcount.(($pcount == 1) ? ' Party, ' : ' Parties, ').$ucount.(($ucount == 1) ? ' Partygoer, ' : ' Partygoers, ');
|
||||
$difference = 1161975280 - time();
|
||||
$days_left = floor($difference/60/60/24);
|
||||
echo $days_left." days until Firefox 2!"; ?><br/></div>
|
||||
echo "and ".$days_left." days until Firefox 2!"; ?><br/></div>
|
||||
|
||||
<div>
|
||||
<div style="float: left; width: 75%">
|
||||
|
@ -18,6 +19,6 @@ Maecenas varius massa sit amet nulla. Nunc sit amet mauris. Nunc eu purus a sapi
|
|||
<li><a href="<?php echo $html->url('/party/view/all'); ?>">View all parties</a></li>
|
||||
<li><a href="<?php echo $html->url('/user/register'); ?>">Register</a></li>
|
||||
<li><a href="<?php echo $html->url('/party/register'); ?>">Create a party</a></li>
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,124 @@
|
|||
<form action="<?php echo $html->url('/party/edit/'.$party['Party']['id']); ?>" method="post">
|
||||
<?php echo $html->hidden('Party/id'); ?>
|
||||
<div>
|
||||
<h2>Details</h2>
|
||||
<hr/>
|
||||
<label for="name">Party Name:</label>
|
||||
<?php echo $html->input('Party/name', array('size' => 35)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="">Venue Name:</label>
|
||||
<?php echo $html->input('Party/vname', array('size' => 35)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="website">Web site:</label>
|
||||
<?php echo $html->input('Party/website', array('size' => 35)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="address">Address:</label>
|
||||
<?php echo $html->input('Party/address', array('size' => 35, 'id' => 'location', 'onkeypress' => 'capture(event)', 'onblur' => 'update()')); ?>
|
||||
<div id="suggest" style="display: none">Did you mean <span style="font-style: italic"><a id="suggest2" href="#" onclick=""></a></span>?</div>
|
||||
</div>
|
||||
<?php if(GMAP_API_KEY != null): ?>
|
||||
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo GMAP_API_KEY; ?>"
|
||||
type="text/javascript"></script>
|
||||
<script src="<?php echo $html->url('/js/maps.js'); ?>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
//<![CDATA[
|
||||
function update(aSuggest) {
|
||||
var loc;
|
||||
if (!aSuggest)
|
||||
loc = document.getElementById("location").value;
|
||||
else
|
||||
loc = aSuggest;
|
||||
|
||||
if (loc != "")
|
||||
geocode(loc);
|
||||
}
|
||||
|
||||
function capture(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
update();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<div style="width: 350px; height: 200px;">
|
||||
<div id="maperror" style="display: none" class="error"></div>
|
||||
<div id="map" style="height: 100%; width: 100%;"></div>
|
||||
</div>
|
||||
<div>
|
||||
Additional notes:<br/>
|
||||
<?php echo $html->textarea('Party/notes'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Date</h2>
|
||||
<hr/>
|
||||
<label for="date">Date:</label>
|
||||
<?php echo $html->yearOptionTag('Party/year', null, date('Y'), MAX_YEAR, date('Y'), null, null, false); ?>-<?php echo $html->hourOptionTag('Party/month', null, false, date('m')); ?>-<?php echo $html->dayOptionTag('Party/day', null, date('d'), null, false); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="time">Time:</label>
|
||||
<?php echo $html->hourOptionTag('Party/hour', null, true);?>:<?php echo $html->minuteOptionTag('Party/minute');?>
|
||||
<?php echo $html->radio('Party/confirmed', array(0 => 'Tentative', 1 => 'Confirmed')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserTz">Timezone (current time is <?php echo gmdate("Y-m-d H:i:s"); ?>GMT):</label>
|
||||
<select name="data[Party][tz]" id="UserTz">
|
||||
<option value="-12">GMT-12</option>
|
||||
<option value="-11">GMT-11</option>
|
||||
<option value="-10">GMT-10</option>
|
||||
<option value="-9">GMT-9</option>
|
||||
<option value="-8">GMT-8</option>
|
||||
<option value="-7">GMT-7</option>
|
||||
<option value="-6">GMT-6</option>
|
||||
<option value="-5">GMT-5</option>
|
||||
<option value="-4">GMT-4</option>
|
||||
<option value="-3">GMT-3</option>
|
||||
<option value="-2">GMT-2</option>
|
||||
<option value="-1">GMT-1</option>
|
||||
<option value="0" selected="selected">GMT+0</option>
|
||||
<option value="1">GMT+1</option>
|
||||
<option value="2">GMT+2</option>
|
||||
<option value="3">GMT+3</option>
|
||||
<option value="4">GMT+4</option>
|
||||
<option value="5">GMT+5</option>
|
||||
<option value="6">GMT+6</option>
|
||||
<option value="7">GMT+7</option>
|
||||
<option value="8">GMT+8</option>
|
||||
<option value="9">GMT+9</option>
|
||||
<option value="10">GMT+10</option>
|
||||
<option value="11">GMT+11</option>
|
||||
<option value="12">GMT+12</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<h2><span style="color: #0063dc">flick</span><span style="color: #ff0084">r</span> integration</h2>
|
||||
<hr/>
|
||||
<p>To show photos of your party, simply tag them with <strong><?php echo FLICKR_TAG_PREFIX.$party['Party']['id'] ?></strong> and fill out the information below.</p>
|
||||
<label for="PartyUseflickr">Show photostream:</label>
|
||||
<?php echo $html->checkbox('Party/useflickr'); ?><br/>
|
||||
<label for="PartyFlickruse">Show:</label>
|
||||
<?php echo $html->radio('Party/flickruse', array(0 => 'Only my photos', 1 => 'Anyone\'s photos')); ?><br/>
|
||||
<label for="website">Flickr username:</label>
|
||||
<?php echo $html->input('Party/flickrusr', array('size' => 35)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Privacy</h2>
|
||||
<hr/>
|
||||
<label for="PartyInviteonly">Invite only:</label>
|
||||
<?php echo $html->checkbox('Party/inviteonly'); ?><br/>
|
||||
<label for="PartyGuestsonly">Show full address to party guests only:</label>
|
||||
<?php echo $html->checkbox('Party/guestsonly'); ?><br/>
|
||||
<label for="PartyGuestcomments">Limit comments to party guests only:</label>
|
||||
<?php echo $html->checkbox('Party/guestcomments'); ?><br/>
|
||||
</div>
|
||||
<?php echo $html->hidden('Party/lat', array('id' => 'lat'));
|
||||
echo $html->hidden('Party/long', array('id' => 'long'));
|
||||
echo $html->hidden('Party/zoom', array('id' => 'zoom'));
|
||||
echo $html->hidden('Party/geocoded', array('id' => 'geocoded', 'value' => 0)); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $html->submit('Update'); ?>
|
||||
</form>
|
|
@ -22,7 +22,35 @@
|
|||
<div>
|
||||
<label for="time">Time:</label>
|
||||
<?php echo $html->hourOptionTag('Party/hour', null, true);?>:<?php echo $html->minuteOptionTag('Party/minute');?>
|
||||
<?php echo $html->radio('Party/confirmed', array(0 => 'Tentative', 1 => 'Confirmed')); ?>
|
||||
<?php echo $html->radio('Party/confirmed', array(0 => 'Tentative', 1 => 'Confirmed')); ?><br/>
|
||||
<label for="UserTz">Timezone (current time is <?php echo gmdate("Y-m-d H:i:s"); ?>GMT):</label>
|
||||
<select name="data[Party][tz]" id="UserTz">
|
||||
<option value="-12">GMT-12</option>
|
||||
<option value="-11">GMT-11</option>
|
||||
<option value="-10">GMT-10</option>
|
||||
<option value="-9">GMT-9</option>
|
||||
<option value="-8">GMT-8</option>
|
||||
<option value="-7">GMT-7</option>
|
||||
<option value="-6">GMT-6</option>
|
||||
<option value="-5">GMT-5</option>
|
||||
<option value="-4">GMT-4</option>
|
||||
<option value="-3">GMT-3</option>
|
||||
<option value="-2">GMT-2</option>
|
||||
<option value="-1">GMT-1</option>
|
||||
<option value="0" selected="selected">GMT+0</option>
|
||||
<option value="1">GMT+1</option>
|
||||
<option value="2">GMT+2</option>
|
||||
<option value="3">GMT+3</option>
|
||||
<option value="4">GMT+4</option>
|
||||
<option value="5">GMT+5</option>
|
||||
<option value="6">GMT+6</option>
|
||||
<option value="7">GMT+7</option>
|
||||
<option value="8">GMT+8</option>
|
||||
<option value="9">GMT+9</option>
|
||||
<option value="10">GMT+10</option>
|
||||
<option value="11">GMT+11</option>
|
||||
<option value="12">GMT+12</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="website">Web site:</label>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
if (!empty($party['Party']['vname']))
|
||||
echo 'Venue: '.$party['Party']['vname']."<br/>\n";
|
||||
|
||||
echo 'Date: '.(($party['Party']['confirmed'] == 1) ? date('Y-m-d h:m', $party['Party']['date']) : "TBA")."<br/>\n";
|
||||
echo 'Date: '.(($party['Party']['confirmed'] == 1) ? gmdate('Y-m-d h:ia', $party['Party']['date'] + (@$_SESSION['User']['tz'] * 60 * 60))." GMT".@$_SESSION['User']['tz'] : "TBA")."<br/>\n";
|
||||
|
||||
if (!empty($party['Party']['website']))
|
||||
echo 'Website: <a href="'.$party['Party']['website'].'" rel="nofollow">'.$party['Party']['website']."</a><br/>\n";
|
||||
|
@ -22,17 +22,24 @@
|
|||
type="text/javascript"></script>
|
||||
<script src="<?php echo $html->url('/js/maps.js'); ?>" type="text/javascript"></script>
|
||||
<div id="map" style="height: 200px; width: 400px;"></div>
|
||||
<h2>Who's coming:</h2>
|
||||
<h2>Who's coming</h2>
|
||||
<div>
|
||||
<?php if (isset($guests)):
|
||||
$i = 0;
|
||||
$c = count($guests) - 1;
|
||||
foreach ($guests as $guest): ?>
|
||||
<a href="<?php echo $html->url('/user/view/'.$guest); ?>"><?php echo $names[$i]; ?></a><?php echo ($i < $c) ? ", " : ""; ?>
|
||||
<?php $i++; endforeach; endif; if (isset($_SESSION['User']['id'])):?>
|
||||
<?php $i++;
|
||||
endforeach;
|
||||
else:
|
||||
echo "No guests yet, be the first!";
|
||||
endif;
|
||||
|
||||
@$isguest = (isset($guests)) ? in_array($_SESSION['User']['id'], $guests) : 0;
|
||||
|
||||
if (isset($_SESSION['User']['id']) && @$_SESSION['User']['id'] != $party['Party']['owner'] && ($party['Party']['inviteonly'] != 1 || $isguest)):?>
|
||||
<br/><br/>
|
||||
<form action="<?php
|
||||
$isguest = (isset($guests)) ? in_array($_SESSION['User']['id'], $guests) : 0;
|
||||
echo $html->url('/party/'.((!$isguest) ? 'rsvp/' : 'unrsvp/').$party['Party']['id']); ?>" method="post">
|
||||
<?php if(!$isguest): ?>
|
||||
<button>Count me in!</button>
|
||||
|
@ -42,16 +49,21 @@
|
|||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (@$_SESSION['User']['id'] == $party['Party']['owner']):?>
|
||||
<h2>Party options</h2>
|
||||
<a href="<?php echo $html->url('/party/edit/'.$party['Party']['id']);?>">Edit party</a>
|
||||
<a href="<?php echo $html->url('/party/invite/'.$party['Party']['id']);?>">Invite a guest</a>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($flickr)): ?>
|
||||
<a id="photos"></a>
|
||||
<h2>Photos:</h2>
|
||||
<h2>Photos</h2>
|
||||
<?php foreach ($flickr as $pic): ?>
|
||||
<a href="http://www.flickr.com/photos/<?php echo $pic['owner']."/".$pic['id']."/" ?>"><img src="http://static.flickr.com/<?php echo $pic['server']."/".$pic['id']."_".$pic['secret']."_s.jpg" ?>"/></a>
|
||||
<?php endforeach; ?>
|
||||
<br/>
|
||||
<?php endif;
|
||||
if (!empty($comments)): ?>
|
||||
<h2>Comments:</h2>
|
||||
<h2>Comments</h2>
|
||||
<?php $i = 0;
|
||||
foreach ($comments as $comment):
|
||||
if ($i % 2 == 0)
|
||||
|
@ -59,11 +71,14 @@
|
|||
else
|
||||
$color = "#DDD";
|
||||
$i++;?>
|
||||
<div style="border-top: 1px solid #555; background: <?php echo $color;?>"><?php echo $comment['comments']['text']; ?><br/>Posted by <a href="<?php echo $html->url('/user/view/'.$comment['users']['uid']); ?>"><?php echo $comment['users']['name']; ?></a> on <?php echo date('Y-m-d h:ia', $comment['comments']['time']); ?></span></div>
|
||||
<div style="border-top: 1px solid #555; background: <?php echo $color;?>"><?php echo $comment['comments']['text']; ?>
|
||||
<br/>Posted by <a href="<?php echo $html->url('/user/view/'.$comment['users']['uid']); ?>">
|
||||
<?php echo $comment['users']['name']; ?></a> on <?php echo date('Y-m-d h:ia', $comment['comments']['time'] - (@$_SESSION['User']['tz'] * 60 * 60))." GMT".@$_SESSION['User']['tz']; ?></span>
|
||||
</div>
|
||||
<?php endforeach;
|
||||
endif;
|
||||
if (isset($_SESSION['User'])): ?>
|
||||
<h2>Add a comment:</h2>
|
||||
<h2>Add a comment</h2>
|
||||
<form action="<?php echo $html->url('/comment/add/'.$party['Party']['id'].'/'.$_SESSION['User']['id']); ?>" method="post">
|
||||
<div>
|
||||
<?php echo $html->textarea('Comment/text', array('rows' => 10, 'cols' => 50))."<br/>".$html->submit('Submit'); ?>
|
||||
|
@ -93,7 +108,7 @@
|
|||
if (!empty($party['Party']['vname']))
|
||||
echo 'Venue: '.$party['Party']['vname']."<br/>\n";
|
||||
|
||||
echo 'Date: '.(($party['Party']['confirmed'] == 1) ? date('Y-m-d h:m', $party['Party']['date']) : "TBA")."<br/>\n";
|
||||
echo 'Date: '.(($party['Party']['confirmed'] == 1) ? gmdate('Y-m-d h:ia', $party['Party']['date'] + (@$_SESSION['User']['tz'] * 60 * 60))." GMT".@$_SESSION['User']['tz'] : "TBA")."<br/>\n";
|
||||
|
||||
if (!empty($party['Party']['website']))
|
||||
echo 'Website: <a href="'.$party['Party']['website'].'" rel="nofollow">'.$party['Party']['website']."</a><br/>\n";
|
||||
|
@ -102,7 +117,7 @@
|
|||
|
||||
?>
|
||||
</div>
|
||||
<?php endforeach;
|
||||
<?php endforeach;
|
||||
if (isset($prev))
|
||||
echo '<a href="'.$html->url('/party/view/all/'.$prev).'">Previous Page</a> ';
|
||||
if (isset($next))
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
<?php if ($error): ?>
|
||||
<p>There was an error in your submission, please try again.</p>
|
||||
<?php endif; ?>
|
||||
<form action="<?php echo $html->url('/user/register'); ?>" method="post">
|
||||
<form action="<?php echo $html->url('/user/edit'); ?>" method="post">
|
||||
<?php echo $html->hidden('User/id'); ?>
|
||||
<div>
|
||||
<h2>Profile</h2>
|
||||
<hr/>
|
||||
<label for="name">Name:</label>
|
||||
<?php echo $html->input('User/name', array('size' => 20, 'value' => $user['User']['name'])); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password"><strong>Password</strong>:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 20)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/password', 'Passwords don\'t match!')?>
|
||||
<?php echo $html->input('User/name', array('size' => 20)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confpassword"><strong>Confirm password</strong>:</label>
|
||||
<?php echo $html->password('User/confpassword', array('size' => 20)); ?>
|
||||
<label for="name">Website:</label>
|
||||
<?php echo $html->input('User/website', array('size' => 20)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="location">Location:</label>
|
||||
<?php echo $html->input('User/location', array('id' => 'location', 'size' => 20, 'onkeypress' => 'capture(event)', 'value' => $user['User']['location'])); ?>
|
||||
<?php echo $html->input('User/location', array('id' => 'location', 'size' => 20, 'onkeypress' => 'capture(event)')); ?>
|
||||
</div>
|
||||
<?php if(GMAP_API_KEY != null): ?>
|
||||
<a onclick="update()">Update map</a>
|
||||
|
@ -40,15 +38,34 @@
|
|||
}
|
||||
//]]>
|
||||
</script>
|
||||
<div style="width: 500px; height: 300px">
|
||||
<div style="width: 400px; height: 250px">
|
||||
<div id="maperror" style="display: none" class="error"></div>
|
||||
<div id="map" style="height: 100%; width: 100%;"></div>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo $html->hidden('User/lat', array('id' => 'lat'));
|
||||
echo $html->hidden('User/long', array('id' => 'long'));
|
||||
echo $html->hidden('User/zoom', array('id' => 'zoom')); ?>
|
||||
<h2>Privacy</h2>
|
||||
<hr/>
|
||||
<label for="UserShowemail">Show email:</label>
|
||||
<?php echo $html->checkbox('User/showemail'); ?><br/>
|
||||
<label for="UserShowloc">Show location:</label>
|
||||
<?php echo $html->checkbox('User/showloc'); ?><br/>
|
||||
<label for="UserShowmap">Show map:</label>
|
||||
<?php echo $html->checkbox('User/showmap'); ?><br/>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Password</h2>
|
||||
<hr/>
|
||||
<label for="password">New password:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 20)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/password', 'Passwords don\'t match!')?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confpassword">Confirm new password:</label>
|
||||
<?php echo $html->password('User/confpassword', array('size' => 20)); ?>
|
||||
</div>
|
||||
<?php echo $html->hidden('User/lat', array('id' => 'lat'));
|
||||
echo $html->hidden('User/long', array('id' => 'long'));
|
||||
echo $html->hidden('User/zoom', array('id' => 'zoom')); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $html->submit('Update'); ?>
|
||||
</form>
|
|
@ -24,6 +24,36 @@
|
|||
<label for="location">Location:</label>
|
||||
<?php echo $html->input('User/location', array('id' => 'location', 'size' => 20, 'onkeypress' => 'capture(event)')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserTz">Timezone (current time is <?php echo gmdate("Y-m-d H:i:s"); ?>GMT):</label>
|
||||
<select name="data[User][tz]" id="UserTz">
|
||||
<option value="-12">GMT-12</option>
|
||||
<option value="-11">GMT-11</option>
|
||||
<option value="-10">GMT-10</option>
|
||||
<option value="-9">GMT-9</option>
|
||||
<option value="-8">GMT-8</option>
|
||||
<option value="-7">GMT-7</option>
|
||||
<option value="-6">GMT-6</option>
|
||||
<option value="-5">GMT-5</option>
|
||||
<option value="-4">GMT-4</option>
|
||||
<option value="-3">GMT-3</option>
|
||||
<option value="-2">GMT-2</option>
|
||||
<option value="-1">GMT-1</option>
|
||||
<option value="0" selected="selected">GMT+0</option>
|
||||
<option value="1">GMT+1</option>
|
||||
<option value="2">GMT+2</option>
|
||||
<option value="3">GMT+3</option>
|
||||
<option value="4">GMT+4</option>
|
||||
<option value="5">GMT+5</option>
|
||||
<option value="6">GMT+6</option>
|
||||
<option value="7">GMT+7</option>
|
||||
<option value="8">GMT+8</option>
|
||||
<option value="9">GMT+9</option>
|
||||
<option value="10">GMT+10</option>
|
||||
<option value="11">GMT+11</option>
|
||||
<option value="12">GMT+12</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="website">Website:</label>
|
||||
<?php echo $html->input('User/website', array('size' => 20)); ?>
|
||||
|
@ -56,7 +86,8 @@
|
|||
<div>
|
||||
<?php echo $html->hidden('User/lat', array('id' => 'lat'));
|
||||
echo $html->hidden('User/long', array('id' => 'long'));
|
||||
echo $html->hidden('User/zoom', array('id' => 'zoom')); ?>
|
||||
echo $html->hidden('User/zoom', array('id' => 'zoom'));
|
||||
echo $html->hidden('User/icode', array('value' => $icode)); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $html->submit('Register'); ?>
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
if (!empty($user['User']['name']))
|
||||
echo "<h1>".$user['User']['name']."</h1>";
|
||||
|
||||
if ($user['User']['showemail'] == 1 && @$_SESSION['User'])
|
||||
echo "Email: ".$user['User']['email']."<br/>";
|
||||
|
||||
if ($user['User']['showloc'] == 1 && !empty($user['User']['location']))
|
||||
echo "Location: ".$user['User']['location']."<br/>";
|
||||
|
||||
if (!empty($user['User']['website']))
|
||||
echo 'Website: <a href="'.$user['User']['website'].'" rel="nofollow">'.$user['User']['website'].'</a><br/>';
|
||||
|
||||
echo "Attending: ";
|
||||
$c = count($parties) - 1;
|
||||
$i = 0;
|
||||
foreach ($parties as $party) {
|
||||
echo '<a href="'.$html->url('/party/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '';
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if(isset($body_args) && $user['User']['showmap'] == 1): ?>
|
||||
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo GMAP_API_KEY; ?>" type="text/javascript"></script>
|
||||
<script src="<?php echo $html->url('/js/maps.js'); ?>" type="text/javascript"></script>
|
||||
<div id="map" style="height: 200px; width: 350px;"></div>
|
||||
<?php endif; ?>
|
|
@ -1,6 +0,0 @@
|
|||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
|
||||
</IfModule>
|
|
@ -1,104 +1,104 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: css.php,v 1.1 2006-09-11 05:56:11 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-09-11 05:56:11 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
if (!defined(CAKE_CORE_INCLUDE_PATH)) {
|
||||
die('You can not access this file directly');
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
require(CONFIGS . 'paths.php');
|
||||
require(CAKE . 'basics.php');
|
||||
require(LIBS . 'folder.php');
|
||||
require(LIBS . 'file.php');
|
||||
require(LIBS . 'legacy.php');
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $path
|
||||
* @param unknown_type $name
|
||||
* @return unknown
|
||||
*/
|
||||
function make_clean_css($path, $name) {
|
||||
require(VENDORS . 'csspp' . DS . 'csspp.php');
|
||||
$data =file_get_contents($path);
|
||||
$csspp =new csspp();
|
||||
$output=$csspp->compress($data);
|
||||
$ratio =100 - (round(strlen($output) / strlen($data), 3) * 100);
|
||||
$output=" /* file: $name, ratio: $ratio% */ " . $output;
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $path
|
||||
* @param unknown_type $content
|
||||
* @return unknown
|
||||
*/
|
||||
function write_css_cache($path, $content) {
|
||||
if (!is_dir(dirname($path))) {
|
||||
mkdir(dirname($path));
|
||||
}
|
||||
$cache=new File($path);
|
||||
return $cache->write($content);
|
||||
}
|
||||
|
||||
if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) {
|
||||
die('Wrong file name.');
|
||||
}
|
||||
|
||||
$filename = 'css/' . $regs[1];
|
||||
$filepath = CSS . $regs[1];
|
||||
$cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]);
|
||||
|
||||
if (!file_exists($filepath)) {
|
||||
die('Wrong file name.');
|
||||
}
|
||||
|
||||
if (file_exists($cachepath)) {
|
||||
$templateModified=filemtime($filepath);
|
||||
$cacheModified =filemtime($cachepath);
|
||||
|
||||
if ($templateModified > $cacheModified) {
|
||||
$output=make_clean_css($filepath, $filename);
|
||||
write_css_cache($cachepath, $output);
|
||||
} else {
|
||||
$output = file_get_contents($cachepath);
|
||||
}
|
||||
} else {
|
||||
$output=make_clean_css($filepath, $filename);
|
||||
write_css_cache($cachepath, $output);
|
||||
}
|
||||
|
||||
header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT');
|
||||
header("Content-Type: text/css");
|
||||
header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
|
||||
header("Cache-Control: cache"); // HTTP/1.1
|
||||
header("Pragma: cache"); // HTTP/1.0
|
||||
print $output;
|
||||
<?php
|
||||
/* SVN FILE: $Id: css.php,v 1.3 2006-09-28 03:22:10 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.3 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-09-28 03:22:10 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
if (!defined(CAKE_CORE_INCLUDE_PATH)) {
|
||||
die('You can not access this file directly');
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
require(CONFIGS . 'paths.php');
|
||||
require(CAKE . 'basics.php');
|
||||
require(LIBS . 'folder.php');
|
||||
require(LIBS . 'file.php');
|
||||
require(LIBS . 'legacy.php');
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $path
|
||||
* @param unknown_type $name
|
||||
* @return unknown
|
||||
*/
|
||||
function make_clean_css($path, $name) {
|
||||
require(VENDORS . 'csspp' . DS . 'csspp.php');
|
||||
$data =file_get_contents($path);
|
||||
$csspp =new csspp();
|
||||
$output=$csspp->compress($data);
|
||||
$ratio =100 - (round(strlen($output) / strlen($data), 3) * 100);
|
||||
$output=" /* file: $name, ratio: $ratio% */ " . $output;
|
||||
return $output;
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*
|
||||
* @param unknown_type $path
|
||||
* @param unknown_type $content
|
||||
* @return unknown
|
||||
*/
|
||||
function write_css_cache($path, $content) {
|
||||
if (!is_dir(dirname($path))) {
|
||||
mkdir(dirname($path));
|
||||
}
|
||||
$cache=new File($path);
|
||||
return $cache->write($content);
|
||||
}
|
||||
|
||||
if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) {
|
||||
die('Wrong file name.');
|
||||
}
|
||||
|
||||
$filename = 'css/' . $regs[1];
|
||||
$filepath = CSS . $regs[1];
|
||||
$cachepath = CACHE . 'css' . DS . str_replace(array('/','\\'), '-', $regs[1]);
|
||||
|
||||
if (!file_exists($filepath)) {
|
||||
die('Wrong file name.');
|
||||
}
|
||||
|
||||
if (file_exists($cachepath)) {
|
||||
$templateModified=filemtime($filepath);
|
||||
$cacheModified =filemtime($cachepath);
|
||||
|
||||
if ($templateModified > $cacheModified) {
|
||||
$output=make_clean_css($filepath, $filename);
|
||||
write_css_cache($cachepath, $output);
|
||||
} else {
|
||||
$output = file_get_contents($cachepath);
|
||||
}
|
||||
} else {
|
||||
$output=make_clean_css($filepath, $filename);
|
||||
write_css_cache($cachepath, $output);
|
||||
}
|
||||
|
||||
header("Date: " . date("D, j M Y G:i:s ", $templateModified) . 'GMT');
|
||||
header("Content-Type: text/css");
|
||||
header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT");
|
||||
header("Cache-Control: cache"); // HTTP/1.1
|
||||
header("Pragma: cache"); // HTTP/1.0
|
||||
print $output;
|
||||
?>
|
|
@ -1,74 +1,81 @@
|
|||
.error {
|
||||
background: #ffa5a5;
|
||||
border: 1px solid red;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
.info {
|
||||
background: #fffe94;
|
||||
border: 1px solid yellow;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
#user {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
img { border: 1px solid #555 }
|
||||
|
||||
body {
|
||||
background: #fff url("/cake/img/body_back.png") top repeat-x;
|
||||
color: #555;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
font-size: x-small;
|
||||
voice-family: "\"}\"";
|
||||
voice-family: inherit;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
a { color: #34518c; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
|
||||
#container {
|
||||
width: 742px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
padding: 22px 0;
|
||||
}
|
||||
|
||||
#mozilla-com a {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
text-indent: -5000em;
|
||||
width: 110px;
|
||||
height: 25px;
|
||||
text-decoration: none;
|
||||
background: url("/cake/img/mozilla-org.png") no-repeat;
|
||||
}
|
||||
|
||||
#header {
|
||||
background: url("/cake/img/header.gif") no-repeat;
|
||||
color: white;
|
||||
font-family: Arial;
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
height: 127px;
|
||||
}
|
||||
|
||||
#header a { color: white; text-decoration: none; }
|
||||
|
||||
#map {
|
||||
border: 1px solid #555;
|
||||
.error, .error_message {
|
||||
background: #ffa5a5;
|
||||
border: 1px solid red;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
.form_error {
|
||||
background: #ffa5a5;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.info {
|
||||
background: #fffe94;
|
||||
border: 1px solid yellow;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
padding: 5px;
|
||||
margin: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
#user {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
img { border: 1px solid #555 }
|
||||
|
||||
h2 + hr { padding: 0; margin: 0;}
|
||||
|
||||
body {
|
||||
background: #fff url("/cake/img/body_back.png") top repeat-x;
|
||||
color: #555;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0 10px;
|
||||
padding: 0;
|
||||
font-size: x-small;
|
||||
voice-family: "\"}\"";
|
||||
voice-family: inherit;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
a { color: #34518c; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
|
||||
#container {
|
||||
width: 742px;
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
padding: 22px 0;
|
||||
}
|
||||
|
||||
#mozilla-com a {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
text-indent: -5000em;
|
||||
width: 110px;
|
||||
height: 25px;
|
||||
text-decoration: none;
|
||||
background: url("/cake/img/mozilla-org.png") no-repeat;
|
||||
}
|
||||
|
||||
#header {
|
||||
background: url("/cake/img/header.gif") no-repeat;
|
||||
color: white;
|
||||
font-family: Arial;
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
height: 127px;
|
||||
}
|
||||
|
||||
#header a { color: white; text-decoration: none; }
|
||||
|
||||
#map {
|
||||
border: 1px solid #555;
|
||||
}
|
|
@ -1,87 +1,87 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.1 2006-09-11 05:56:11 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-09-11 05:56:11 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Do not change
|
||||
*/
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
/**
|
||||
* These defines should only be edited if you have cake installed in
|
||||
* a directory layout other than the way it is distributed.
|
||||
* Each define has a commented line of code that explains what you would change.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
//define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
|
||||
//You should also use the DS define to seperate your directories
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
}
|
||||
if (!defined('APP_DIR')) {
|
||||
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
}
|
||||
/**
|
||||
* This only needs to be changed if the cake installed libs are located
|
||||
* outside of the distributed directory structure.
|
||||
*/
|
||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
|
||||
//You should also use the DS define to seperate your directories
|
||||
define('CAKE_CORE_INCLUDE_PATH', ROOT);
|
||||
}
|
||||
///////////////////////////////
|
||||
//DO NOT EDIT BELOW THIS LINE//
|
||||
///////////////////////////////
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
}
|
||||
if (!defined('WWW_ROOT')) {
|
||||
define('WWW_ROOT', dirname(__FILE__) . DS);
|
||||
}
|
||||
if (!defined('CORE_PATH')) {
|
||||
if (function_exists('ini_set')) {
|
||||
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
|
||||
define('APP_PATH', null);
|
||||
define('CORE_PATH', null);
|
||||
} else {
|
||||
define('APP_PATH', ROOT . DS . APP_DIR . DS);
|
||||
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
||||
}
|
||||
}
|
||||
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
||||
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
|
||||
} else {
|
||||
$Dispatcher=new Dispatcher();
|
||||
$Dispatcher->dispatch($url);
|
||||
}
|
||||
if (DEBUG) {
|
||||
echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
|
||||
}
|
||||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.4 2006-10-08 03:39:23 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* Long description for file
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.4 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-10-08 03:39:23 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Do not change
|
||||
*/
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
/**
|
||||
* These defines should only be edited if you have cake installed in
|
||||
* a directory layout other than the way it is distributed.
|
||||
* Each define has a commented line of code that explains what you would change.
|
||||
*
|
||||
*/
|
||||
if (!defined('ROOT')) {
|
||||
//define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
|
||||
//You should also use the DS define to seperate your directories
|
||||
define('ROOT', dirname(dirname(dirname(__FILE__))));
|
||||
}
|
||||
if (!defined('APP_DIR')) {
|
||||
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
|
||||
define('APP_DIR', basename(dirname(dirname(__FILE__))));
|
||||
}
|
||||
/**
|
||||
* This only needs to be changed if the cake installed libs are located
|
||||
* outside of the distributed directory structure.
|
||||
*/
|
||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
|
||||
//You should also use the DS define to seperate your directories
|
||||
define('CAKE_CORE_INCLUDE_PATH', ROOT);
|
||||
}
|
||||
///////////////////////////////
|
||||
//DO NOT EDIT BELOW THIS LINE//
|
||||
///////////////////////////////
|
||||
if (!defined('WEBROOT_DIR')) {
|
||||
define('WEBROOT_DIR', basename(dirname(__FILE__)));
|
||||
}
|
||||
if (!defined('WWW_ROOT')) {
|
||||
define('WWW_ROOT', dirname(__FILE__) . DS);
|
||||
}
|
||||
if (!defined('CORE_PATH')) {
|
||||
if (function_exists('ini_set')) {
|
||||
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
|
||||
define('APP_PATH', null);
|
||||
define('CORE_PATH', null);
|
||||
} else {
|
||||
define('APP_PATH', ROOT . DS . APP_DIR . DS);
|
||||
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
|
||||
}
|
||||
}
|
||||
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
|
||||
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
|
||||
} else {
|
||||
$Dispatcher=new Dispatcher();
|
||||
$Dispatcher->dispatch($url);
|
||||
}
|
||||
if (DEBUG) {
|
||||
echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
|
||||
}
|
||||
?>
|
|
@ -1,36 +1,36 @@
|
|||
<?php
|
||||
/* SVN FILE: $Id: vendors.php,v 1.1 2006-09-11 05:56:11 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* This file includes js vendor-files from /vendor/ directory if they need to
|
||||
* be accessible to the public.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot.js
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.1 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-09-11 05:56:11 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
if (is_file('../../vendors/javascript/' . $_GET['file']) && (preg_match('/(.+)\\.js/', $_GET['file']))) {
|
||||
readfile('../../vendors/javascript/' . $_GET['file']);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/* SVN FILE: $Id: vendors.php,v 1.3 2006-09-28 03:22:10 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* This file includes js vendor-files from /vendor/ directory if they need to
|
||||
* be accessible to the public.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
||||
* Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* 1785 E. Sahara Avenue, Suite 490-204
|
||||
* Las Vegas, Nevada 89104
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @filesource
|
||||
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
|
||||
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
||||
* @package cake
|
||||
* @subpackage cake.app.webroot.js
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.3 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-09-28 03:22:10 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
if (is_file('../../vendors/javascript/' . $_GET['file']) && (preg_match('/(.+)\\.js/', $_GET['file']))) {
|
||||
readfile('../../vendors/javascript/' . $_GET['file']);
|
||||
}
|
||||
?>
|
||||
|
|
Загрузка…
Ссылка в новой задаче