Compare commits
3 Commits
PARTYTOOL1
...
LEAF_20031
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5de45ab586 | ||
|
|
3273ea9790 | ||
|
|
ba977c5fc5 |
26
mozilla/tools/tinderbox/INSTALL
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
To install a fresh tinderbox:
|
||||
|
||||
1) Checkout the latest copy of the tinderbox scripts
|
||||
cd /builds/cvs; cvs -z3 co mozilla/tools/tinderbox
|
||||
|
||||
2) Change to the location that you wish to run the tinderbox from.
|
||||
cd /builds/tinderbox
|
||||
|
||||
3) Create links from the cvs directory to your build directory
|
||||
ln -s /builds/cvs/mozilla/tools/tinderbox/*.pl .
|
||||
|
||||
4) Create your tinderbox config file
|
||||
perl ./build-seamonkey.pl --example-config > tinder-config.pl
|
||||
|
||||
5) Create your mozconfig build file in the current dir
|
||||
mozilla -remote http://webtools.mozilla.org/build/config.cgi
|
||||
|
||||
6) Customize your tinderbox configuration
|
||||
vi tinder-config.pl
|
||||
|
||||
7) Test your tinderbox configuration on the test tree
|
||||
perl ./build-seamonkey.pl --depend -t MozillaTest
|
||||
|
||||
8) Once you are satisfied with the results run your tinderbox
|
||||
perl ./build-seamonkey.pl --depend
|
||||
74
mozilla/tools/tinderbox/README
Normal file
@@ -0,0 +1,74 @@
|
||||
mozilla/tools/tinderbox
|
||||
===================
|
||||
|
||||
This directory is for the scripts associated with the client-side of
|
||||
tinderbox (scripts to checkout, build, and report the status of the tree
|
||||
to a tinderbox server).
|
||||
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
* README
|
||||
This file.
|
||||
|
||||
* build-seamonkey.pl
|
||||
A perl script to drive the client side of tinderbox (unix variants).
|
||||
usage:
|
||||
build-seamonkey.pl [--clobber | --depend] [-t TreeName] [--testonly] [--once]
|
||||
|
||||
* bloatdiff.pl
|
||||
Script used to process leak data in the logs.
|
||||
|
||||
* build-seamonkey-util.pl
|
||||
Core unix tinderbox stuff.
|
||||
|
||||
* post-mozilla-sample.pl
|
||||
Example of post-build test script
|
||||
|
||||
* tinder-defaults.pl
|
||||
Default script variables.
|
||||
|
||||
* gettime.pl
|
||||
Wrapper to get hires time, if available.
|
||||
|
||||
* tinderbox
|
||||
Wrapper script to start unix builds.
|
||||
|
||||
* install-links
|
||||
Create links to a tinderbox install directory.
|
||||
|
||||
|
||||
Tinderbox example for SeaMonkey build
|
||||
=====================================
|
||||
|
||||
Here is an example of how to set up a "SeaMonkey" tinderbox
|
||||
build of mozilla.
|
||||
|
||||
# Create tinderbox source files in mozilla,
|
||||
# then SeaMonkey directory where mozilla tree will live.
|
||||
cvs co mozilla/tools/tinderbox
|
||||
mkdir SeaMonkey
|
||||
cd SeaMonkey; ../mozilla/tools/tinderbox/install-links
|
||||
|
||||
#
|
||||
# Create tinder-config.pl file in SeaMonkey directory.
|
||||
# Copy one from an existing build, or create a sample one and edit it:
|
||||
#
|
||||
./build-seamonkey.pl --example-config > tinder-config.pl
|
||||
|
||||
#
|
||||
# mozconfig. If you have configure options, add them to a
|
||||
# file named "mozconfig" in the SeaMonkey directory.
|
||||
# Again, you can copy one from a build, or create one.
|
||||
# For a default stock build, this file is not needed or
|
||||
# can be blank.
|
||||
#
|
||||
|
||||
# Start the tinderbox! From the SeaMonkey directory:
|
||||
./tinderbox depend start
|
||||
|
||||
# You can watch the build run the first time with:
|
||||
tail -f <objdir>/<logname>
|
||||
|
||||
|
||||
332
mozilla/tools/tinderbox/bloatdiff.pl
Executable file
@@ -0,0 +1,332 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
#
|
||||
# Munges the output from
|
||||
# XPCOM_MEM_BLOAT_LOG=1; mozilla-bin -f bloaturls.txt
|
||||
# so that it does some summary and stats stuff.
|
||||
#
|
||||
# To show leak test results for a set of changes, do something like this:
|
||||
#
|
||||
# XPCOM_MEM_BLOAT_LOG=1
|
||||
# mozilla -f bloaturls.txt > a.out
|
||||
# **make change**
|
||||
# mozilla -f bloaturls.txt > b.out
|
||||
# bloatdiff.pl a.out b.out
|
||||
#
|
||||
|
||||
$OLDFILE = $ARGV[0];
|
||||
$NEWFILE = $ARGV[1];
|
||||
$LABEL = $ARGV[2];
|
||||
|
||||
sub processFile {
|
||||
my ($filename, $map, $prevMap) = @_;
|
||||
open(FH, $filename);
|
||||
while (<FH>) {
|
||||
if (m{
|
||||
^\s*(\d+)\s # Line number
|
||||
([\w:]+)\s+ # Name
|
||||
(-?\d+)\s+ # Size
|
||||
(-?\d+)\s+ # Leaked
|
||||
(-?\d+)\s+ # Objects Total
|
||||
(-?\d+)\s+ # Objects Rem
|
||||
\(\s*(-?[\d.]+)\s+ # Objects Mean
|
||||
\+/-\s+
|
||||
([\w.]+)\)\s+ # Objects StdDev
|
||||
(-?\d+)\s+ # Reference Total
|
||||
(-?\d+)\s+ # Reference Rem
|
||||
\(\s*(-?[\d.]+)\s+ # Reference Mean
|
||||
\+/-\s+
|
||||
([\w\.]+)\) # Reference StdDev
|
||||
}x) {
|
||||
$$map{$2} = { name => $2,
|
||||
size => $3,
|
||||
leaked => $4,
|
||||
objTotal => $5,
|
||||
objRem => $6,
|
||||
objMean => $7,
|
||||
objStdDev => $8,
|
||||
refTotal => $9,
|
||||
refRem => $10,
|
||||
refMean => $11,
|
||||
refStdDev => $12,
|
||||
bloat => $3 * $5 # size * objTotal
|
||||
};
|
||||
} else {
|
||||
# print "failed to parse: $_\n";
|
||||
}
|
||||
}
|
||||
close(FH);
|
||||
}
|
||||
|
||||
%oldMap = ();
|
||||
processFile($OLDFILE, \%oldMap);
|
||||
|
||||
%newMap = ();
|
||||
processFile($NEWFILE, \%newMap);
|
||||
|
||||
################################################################################
|
||||
|
||||
$inf = 9999999.99;
|
||||
|
||||
sub getLeaksDelta {
|
||||
my ($key) = @_;
|
||||
my $oldLeaks = $oldMap{$key}{leaked} || 0;
|
||||
my $newLeaks = $newMap{$key}{leaked};
|
||||
my $percentLeaks = 0;
|
||||
if ($oldLeaks == 0) {
|
||||
if ($newLeaks != 0) {
|
||||
# there weren't any leaks before, but now there are!
|
||||
$percentLeaks = $inf;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$percentLeaks = ($newLeaks - $oldLeaks) / $oldLeaks * 100;
|
||||
}
|
||||
# else we had no record of this class before
|
||||
return ($newLeaks - $oldLeaks, $percentLeaks);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
sub getBloatDelta {
|
||||
my ($key) = @_;
|
||||
my $newBloat = $newMap{$key}{bloat};
|
||||
my $percentBloat = 0;
|
||||
my $oldSize = $oldMap{$key}{size} || 0;
|
||||
my $oldTotal = $oldMap{$key}{objTotal} || 0;
|
||||
my $oldBloat = $oldTotal * $oldSize;
|
||||
if ($oldBloat == 0) {
|
||||
if ($newBloat != 0) {
|
||||
# this class wasn't used before, but now it is
|
||||
$percentBloat = $inf;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$percentBloat = ($newBloat - $oldBloat) / $oldBloat * 100;
|
||||
}
|
||||
# else we had no record of this class before
|
||||
return ($newBloat - $oldBloat, $percentBloat);
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
foreach $key (keys %newMap) {
|
||||
my ($newLeaks, $percentLeaks) = getLeaksDelta($key);
|
||||
my ($newBloat, $percentBloat) = getBloatDelta($key);
|
||||
$newMap{$key}{leakDelta} = $newLeaks;
|
||||
$newMap{$key}{leakPercent} = $percentLeaks;
|
||||
$newMap{$key}{bloatDelta} = $newBloat;
|
||||
$newMap{$key}{bloatPercent} = $percentBloat;
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
# Print a value of bytes out in a reasonable
|
||||
# KB, MB, or GB form. Copied from build-seamonkey-util.pl, sorry. -mcafee
|
||||
sub PrintSize($) {
|
||||
|
||||
# print a number with 3 significant figures
|
||||
sub PrintNum($) {
|
||||
my ($num) = @_;
|
||||
my $rv;
|
||||
if ($num < 1) {
|
||||
$rv = sprintf "%.3f", ($num);
|
||||
} elsif ($num < 10) {
|
||||
$rv = sprintf "%.2f", ($num);
|
||||
} elsif ($num < 100) {
|
||||
$rv = sprintf "%.1f", ($num);
|
||||
} else {
|
||||
$rv = sprintf "%d", ($num);
|
||||
}
|
||||
}
|
||||
|
||||
my ($size) = @_;
|
||||
my $rv;
|
||||
if ($size > 1000000000) {
|
||||
$rv = PrintNum($size / 1000000000.0) . "G";
|
||||
} elsif ($size > 1000000) {
|
||||
$rv = PrintNum($size / 1000000.0) . "M";
|
||||
} elsif ($size > 1000) {
|
||||
$rv = PrintNum($size / 1000.0) . "K";
|
||||
} else {
|
||||
$rv = PrintNum($size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "Bloat/Leak Delta Report\n";
|
||||
print "--------------------------------------------------------------------------------------\n";
|
||||
print "Current file: $NEWFILE\n";
|
||||
print "Previous file: $OLDFILE\n";
|
||||
print "----------------------------------------------leaks------leaks%------bloat------bloat%\n";
|
||||
printf "%-40s %10s %10.2f%% %10s %10.2f%%\n",
|
||||
("TOTAL",
|
||||
$newMap{"TOTAL"}{leaked}, $newMap{"TOTAL"}{leakPercent},
|
||||
$newMap{"TOTAL"}{bloat}, $newMap{"TOTAL"}{bloatPercent});
|
||||
|
||||
################################################################################
|
||||
|
||||
sub percentStr {
|
||||
my ($p) = @_;
|
||||
if ($p == $inf) {
|
||||
return "-";
|
||||
}
|
||||
else {
|
||||
return sprintf "%10.2f%%", $p;
|
||||
}
|
||||
}
|
||||
|
||||
# NEW LEAKS
|
||||
@keys = sort { $newMap{$b}{leakPercent} <=> $newMap{$a}{leakPercent} } keys %newMap;
|
||||
my $needsHeading = 1;
|
||||
my $total = 0;
|
||||
foreach $key (@keys) {
|
||||
my $percentLeaks = $newMap{$key}{leakPercent};
|
||||
my $leaks = $newMap{$key}{leaked};
|
||||
if ($percentLeaks > 0 && $key !~ /TOTAL/) {
|
||||
if ($needsHeading) {
|
||||
printf "--NEW-LEAKS-----------------------------------leaks------leaks%%-----------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $leaks, percentStr($percentLeaks));
|
||||
$total += $leaks;
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
printf "%-40s %10s\n", ("TOTAL", $total);
|
||||
}
|
||||
|
||||
# FIXED LEAKS
|
||||
@keys = sort { $newMap{$b}{leakPercent} <=> $newMap{$a}{leakPercent} } keys %newMap;
|
||||
$needsHeading = 1;
|
||||
$total = 0;
|
||||
foreach $key (@keys) {
|
||||
my $percentLeaks = $newMap{$key}{leakPercent};
|
||||
my $leaks = $newMap{$key}{leaked};
|
||||
if ($percentLeaks < 0 && $key !~ /TOTAL/) {
|
||||
if ($needsHeading) {
|
||||
printf "--FIXED-LEAKS---------------------------------leaks------leaks%%-----------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $leaks, percentStr($percentLeaks));
|
||||
$total += $leaks;
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
printf "%-40s %10s\n", ("TOTAL", $total);
|
||||
}
|
||||
|
||||
# NEW BLOAT
|
||||
@keys = sort { $newMap{$b}{bloatPercent} <=> $newMap{$a}{bloatPercent} } keys %newMap;
|
||||
$needsHeading = 1;
|
||||
$total = 0;
|
||||
foreach $key (@keys) {
|
||||
my $percentBloat = $newMap{$key}{bloatPercent};
|
||||
my $bloat = $newMap{$key}{bloat};
|
||||
if ($percentBloat > 0 && $key !~ /TOTAL/) {
|
||||
if ($needsHeading) {
|
||||
printf "--NEW-BLOAT-----------------------------------bloat------bloat%%-----------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $bloat, percentStr($percentBloat));
|
||||
$total += $bloat;
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
printf "%-40s %10s\n", ("TOTAL", $total);
|
||||
}
|
||||
|
||||
# ALL LEAKS
|
||||
@keys = sort { $newMap{$b}{leaked} <=> $newMap{$a}{leaked} } keys %newMap;
|
||||
$needsHeading = 1;
|
||||
$total = 0;
|
||||
foreach $key (@keys) {
|
||||
my $leaks = $newMap{$key}{leaked};
|
||||
my $percentLeaks = $newMap{$key}{leakPercent};
|
||||
if ($leaks > 0) {
|
||||
if ($needsHeading) {
|
||||
printf "--ALL-LEAKS-----------------------------------leaks------leaks%%-----------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $leaks, percentStr($percentLeaks));
|
||||
if ($key !~ /TOTAL/) {
|
||||
$total += $leaks;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
# printf "%-40s %10s\n", ("TOTAL", $total);
|
||||
}
|
||||
|
||||
# ALL BLOAT
|
||||
@keys = sort { $newMap{$b}{bloat} <=> $newMap{$a}{bloat} } keys %newMap;
|
||||
$needsHeading = 1;
|
||||
$total = 0;
|
||||
foreach $key (@keys) {
|
||||
my $bloat = $newMap{$key}{bloat};
|
||||
my $percentBloat = $newMap{$key}{bloatPercent};
|
||||
if ($bloat > 0) {
|
||||
if ($needsHeading) {
|
||||
printf "--ALL-BLOAT-----------------------------------bloat------bloat%%-----------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $bloat, percentStr($percentBloat));
|
||||
if ($key !~ /TOTAL/) {
|
||||
$total += $bloat;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
# printf "%-40s %10s\n", ("TOTAL", $total);
|
||||
}
|
||||
|
||||
# NEW CLASSES
|
||||
@keys = sort { $newMap{$b}{bloatDelta} <=> $newMap{$a}{bloatDelta} } keys %newMap;
|
||||
$needsHeading = 1;
|
||||
my $ltotal = 0;
|
||||
my $btotal = 0;
|
||||
foreach $key (@keys) {
|
||||
my $leaks = $newMap{$key}{leaked};
|
||||
my $bloat = $newMap{$key}{bloat};
|
||||
my $percentBloat = $newMap{$key}{bloatPercent};
|
||||
if ($percentBloat == $inf && $key !~ /TOTAL/) {
|
||||
if ($needsHeading) {
|
||||
printf "--CLASSES-NOT-REPORTED-LAST-TIME--------------leaks------bloat------------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $leaks, $bloat);
|
||||
if ($key !~ /TOTAL/) {
|
||||
$ltotal += $leaks;
|
||||
$btotal += $bloat;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
printf "%-40s %10s %10s\n", ("TOTAL", $ltotal, $btotal);
|
||||
}
|
||||
|
||||
# OLD CLASSES
|
||||
@keys = sort { ($oldMap{$b}{bloat} || 0) <=> ($oldMap{$a}{bloat} || 0) } keys %oldMap;
|
||||
$needsHeading = 1;
|
||||
$ltotal = 0;
|
||||
$btotal = 0;
|
||||
foreach $key (@keys) {
|
||||
if (!defined($newMap{$key})) {
|
||||
my $leaks = $oldMap{$key}{leaked};
|
||||
my $bloat = $oldMap{$key}{bloat};
|
||||
if ($needsHeading) {
|
||||
printf "--CLASSES-THAT-WENT-AWAY----------------------leaks------bloat------------------------\n";
|
||||
$needsHeading = 0;
|
||||
}
|
||||
printf "%-40s %10s %10s\n", ($key, $leaks, $bloat);
|
||||
if ($key !~ /TOTAL/) {
|
||||
$ltotal += $leaks;
|
||||
$btotal += $bloat;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$needsHeading) {
|
||||
printf "%-40s %10s %10s\n", ("TOTAL", $ltotal, $btotal);
|
||||
}
|
||||
|
||||
print "--------------------------------------------------------------------------------------\n";
|
||||
488
mozilla/tools/tinderbox/build-camino.pl
Normal file
@@ -0,0 +1,488 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
|
||||
#
|
||||
# This script gets called after a full mozilla build & test.
|
||||
# Use this to build and test an embedded or commercial branding of Mozilla.
|
||||
#
|
||||
# ./build-seamonkey-utils.pl will call PostMozilla::main() after
|
||||
# a successful build and testing of mozilla. This package can report
|
||||
# status via the $TinderUtils::build_status variable. Yeah this is a hack,
|
||||
# but it works for now. Feel free to improve this mechanism to properly
|
||||
# return values & stuff. -mcafee
|
||||
#
|
||||
# Things to do:
|
||||
# * Get pull by branch working
|
||||
#
|
||||
#
|
||||
use strict;
|
||||
use File::Path; # for rmtree();
|
||||
|
||||
package PostMozilla;
|
||||
|
||||
sub checkout {
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
# chdir to build directory
|
||||
chdir "$mozilla_build_dir";
|
||||
|
||||
# Next, do the checkout:
|
||||
print "Settings::CVS = $Settings::CVS\n";
|
||||
my $status = TinderUtils::run_shell_command("$Settings::CVS checkout mozilla/camino");
|
||||
|
||||
# hack in the camino prefs, if needed
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
sub ReadHeapDumpToHash($$)
|
||||
{
|
||||
my($dumpfile, $hashref) = @_;
|
||||
|
||||
local(*DUMP_FILE);
|
||||
open(DUMP_FILE, "< $dumpfile") || die "Can't open heap output file $dumpfile\n";
|
||||
|
||||
my $section = 0;
|
||||
my $zone = "";
|
||||
my $default_zone_bytes = 0;
|
||||
|
||||
while (<DUMP_FILE>)
|
||||
{
|
||||
my($line) = $_;
|
||||
chomp($line);
|
||||
|
||||
if ($line =~ /^\#/ || $line =~ /^\s*$/ || $line =~ /------------------------/) { # ignore comments and empty lines
|
||||
next;
|
||||
}
|
||||
|
||||
# use the 'All zones' lines as section markers
|
||||
if ($line =~ /^All zones:/) {
|
||||
$section ++;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($section == 2) # we're in the detailed section
|
||||
{
|
||||
if ($line =~ /^Zone ([^_]+).+\((\d+).+\)/)
|
||||
{
|
||||
$zone = $1;
|
||||
if ($zone eq "DefaultMallocZone") {
|
||||
$default_zone_bytes = $2;
|
||||
}
|
||||
TinderUtils::print_log(" $line\n");
|
||||
next;
|
||||
}
|
||||
|
||||
if ($zone eq "DefaultMallocZone")
|
||||
{
|
||||
if ($line =~ /(\w+)\s*=\s*(\d+)\s*\((\d+).+\)/)
|
||||
{
|
||||
my(%entry_hash) = ("count", $2,
|
||||
"bytes", $3);
|
||||
$hashref->{$1} = \%entry_hash;
|
||||
}
|
||||
elsif ($line =~ /^<not.+>\s*=\s*(\d+)\s*\((\d+).+\)/)
|
||||
{
|
||||
my(%entry_hash) = ("count", $1,
|
||||
"bytes", $2);
|
||||
$hashref->{"malloc_block"} = \%entry_hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close(DUMP_FILE);
|
||||
|
||||
return $default_zone_bytes;
|
||||
}
|
||||
|
||||
sub DumpHash($)
|
||||
{
|
||||
my($hashref) = @_;
|
||||
|
||||
print "Dumping values\n";
|
||||
|
||||
my($key);
|
||||
foreach $key (keys %{$hashref})
|
||||
{
|
||||
my($value) = $hashref->{$key};
|
||||
print "Class $key count $value->{'count'} bytes $value->{'bytes'}\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub ClassEntriesEqual($$)
|
||||
{
|
||||
my($hashone, $hashtwo) = @_;
|
||||
|
||||
return ($hashone->{"count"} == $hashtwo->{"count"}) and ($hashone->{"bytes"} == $hashtwo->{"bytes"})
|
||||
}
|
||||
|
||||
|
||||
sub DumpHashDiffs($$)
|
||||
{
|
||||
my($beforehash, $afterhash) = @_;
|
||||
|
||||
my($name_width) = 50;
|
||||
my($print_format) = "%10s %-${name_width}s %8d %8d\n";
|
||||
|
||||
TinderUtils::print_log(sprintf "%10s %-${name_width}s %8s %8s\n", "", "Class", "Count", "Bytes");
|
||||
TinderUtils::print_log("--------------------------------------------------------------------------------\n");
|
||||
|
||||
my($key);
|
||||
foreach $key (keys %{$beforehash})
|
||||
{
|
||||
my($beforevalue) = $beforehash->{$key};
|
||||
|
||||
if (exists $afterhash->{$key})
|
||||
{
|
||||
my($aftervalue) = $afterhash->{$key};
|
||||
if (!ClassEntriesEqual($beforevalue, $aftervalue))
|
||||
{
|
||||
my($count_change) = $aftervalue->{"count"} - $beforevalue->{"count"};
|
||||
my($bytes_change) = $aftervalue->{"bytes"} - $beforevalue->{"bytes"};
|
||||
|
||||
if ($bytes_change > 0) {
|
||||
TinderUtils::print_log(sprintf $print_format, "Leaked", $key, $count_change, $bytes_change);
|
||||
} else {
|
||||
TinderUtils::print_log(sprintf $print_format, "Freed", $key, $count_change, $bytes_change);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#$before_only{$key} = $beforevalue;
|
||||
TinderUtils::print_log(sprintf $print_format, "Freed", $key, $beforevalue->{'count'}, $beforevalue->{'bytes'});
|
||||
}
|
||||
}
|
||||
|
||||
# now look for things only in the after cache
|
||||
foreach $key (keys %{$afterhash})
|
||||
{
|
||||
my($value) = $afterhash->{$key};
|
||||
|
||||
if (!exists $beforehash->{$key})
|
||||
{
|
||||
#$after_only{$key} = $value;
|
||||
TinderUtils::print_log(sprintf $print_format, "Leaked", $key, $value->{'count'}, $value->{'bytes'});
|
||||
}
|
||||
}
|
||||
|
||||
TinderUtils::print_log("--------------------------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
sub ParseHeapOutput($$)
|
||||
{
|
||||
my($beforedump, $afterdump) = @_;
|
||||
|
||||
TinderUtils::print_log("Before window open:\n");
|
||||
my %before_data;
|
||||
my $before_heap = ReadHeapDumpToHash($beforedump, \%before_data);
|
||||
|
||||
TinderUtils::print_log("After window open and close:\n");
|
||||
my %after_data;
|
||||
my $after_heap = ReadHeapDumpToHash($afterdump, \%after_data);
|
||||
|
||||
# DumpHash(\%before_data);
|
||||
# DumpHash(\%after_data);
|
||||
|
||||
TinderUtils::print_log("Open/close window leaks:\n");
|
||||
DumpHashDiffs(\%before_data, \%after_data);
|
||||
|
||||
my $heap_diff = $after_heap - $before_heap;
|
||||
TinderUtils::print_log("TinderboxPrint:<acronym title=\"Per-window leaks\">Lw:".TinderUtils::PrintSize($heap_diff, 3)."B</acronym>\n");
|
||||
}
|
||||
|
||||
|
||||
sub CaminoWindowLeaksTest($$$$$)
|
||||
{
|
||||
my ($test_name, $build_dir, $binary, $args, $timeout_secs) = @_;
|
||||
|
||||
my($status) = 'success';
|
||||
|
||||
my $beforefile = "/tmp/nav_before_heap.dat";
|
||||
my $afterfile = "/tmp/nav_after_heap.dat";
|
||||
|
||||
my $run_test = 1; # useful for testing parsing code
|
||||
if ($run_test)
|
||||
{
|
||||
my $close_window_script =<<END_SCRIPT;
|
||||
tell application "Camino"
|
||||
delay 5
|
||||
close the first window
|
||||
end tell
|
||||
END_SCRIPT
|
||||
|
||||
my $new_window_script =<<END_SCRIPT;
|
||||
tell application "Camino"
|
||||
Get URL "about:blank"
|
||||
delay 20
|
||||
close the first window
|
||||
end tell
|
||||
END_SCRIPT
|
||||
|
||||
TinderUtils::print_log("Window leak test\n");
|
||||
|
||||
my $binary_basename = File::Basename::basename($binary);
|
||||
my $binary_dir = File::Basename::dirname($binary);
|
||||
my $binary_log = "$build_dir/$test_name.log";
|
||||
my $cmd = $binary_basename;
|
||||
|
||||
my $pid = TinderUtils::fork_and_log($build_dir, $binary_dir, $cmd, $binary_log);
|
||||
|
||||
# close the existing window
|
||||
system("echo '$close_window_script' | osascript");
|
||||
# open and close few window to get to a stable point
|
||||
system("echo '$new_window_script' | osascript");
|
||||
|
||||
# dump before data
|
||||
system("heap $pid > $beforefile");
|
||||
|
||||
# run the test
|
||||
system("echo '$new_window_script' | osascript");
|
||||
|
||||
# dump after data
|
||||
system("heap $pid > $afterfile");
|
||||
|
||||
my $result = TinderUtils::wait_for_pid($pid, $timeout_secs);
|
||||
}
|
||||
|
||||
ParseHeapOutput($beforefile, $afterfile);
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
sub main {
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
TinderUtils::print_log("Starting camino build.\n");
|
||||
|
||||
# Tell camino to unbuffer stdio, otherwise when we kill the child process
|
||||
# stdout & stderr won't get flushed.
|
||||
$ENV{MOZ_UNBUFFERED_STDIO} = 1;
|
||||
|
||||
# Pending a config file, stuff things here.
|
||||
my $post_status = 'success'; # Success until we report a failure.
|
||||
my $status = 0; # 0 = success
|
||||
|
||||
# Control tests from here, sorry no config file yet.
|
||||
my $camino_alive_test = 1;
|
||||
my $camino_test8_test = 1;
|
||||
my $camino_layout_performance_test = 1;
|
||||
my $camino_startup_test = 1;
|
||||
my $camino_window_leaks_test = 0;
|
||||
|
||||
my $safari_layout_performance_test = 0;
|
||||
|
||||
my $camino_clean_profile = 1;
|
||||
|
||||
# Build flags
|
||||
my $camino_build_static = 0;
|
||||
my $camino_build_opt = 1;
|
||||
|
||||
my $camino_dir = "$mozilla_build_dir/mozilla/camino";
|
||||
my $embedding_dir = "$mozilla_build_dir/mozilla/embedding/config";
|
||||
my $camino_binary = "Camino";
|
||||
|
||||
unless ($Settings::TestOnly) {
|
||||
# Checkout/update the camino code.
|
||||
$status = checkout($mozilla_build_dir);
|
||||
TinderUtils::print_log("Status from checkout: $status\n");
|
||||
if ($status != 0) {
|
||||
$post_status = 'busted';
|
||||
}
|
||||
|
||||
# Build camino if we passed the checkout command.
|
||||
if ($post_status ne 'busted') {
|
||||
|
||||
#
|
||||
# Build embedding/config.
|
||||
#
|
||||
|
||||
chdir $embedding_dir;
|
||||
|
||||
if ($status == 0) {
|
||||
$status = TinderUtils::run_shell_command("make");
|
||||
TinderUtils::print_log("Status from make: $status\n");
|
||||
}
|
||||
|
||||
#
|
||||
# Build camino.
|
||||
#
|
||||
|
||||
chdir $camino_dir;
|
||||
|
||||
if ($status == 0) {
|
||||
TinderUtils::print_log("Deleting binary...\n");
|
||||
TinderUtils::DeleteBinary("$camino_dir/build/Camino.app/Contents/MacOS/$camino_binary");
|
||||
|
||||
# Always do a clean build; gecko dependencies don't work correctly
|
||||
# for Camino.
|
||||
|
||||
TinderUtils::print_log("Clobbering camino...\n");
|
||||
TinderUtils::run_shell_command("make clean");
|
||||
|
||||
$status = TinderUtils::run_shell_command("make");
|
||||
TinderUtils::print_log("Status from pbxbuild: $status\n");
|
||||
}
|
||||
|
||||
TinderUtils::print_log("Testing build status...\n");
|
||||
if ($status != 0) {
|
||||
TinderUtils::print_log("busted, pbxbuild status non-zero\n");
|
||||
$post_status = 'busted';
|
||||
} elsif (not TinderUtils::BinaryExists("$camino_dir/build/Camino.app/Contents/MacOS/$camino_binary")) {
|
||||
TinderUtils::print_log("Error: binary not found: $camino_dir/build/Camino.app/Contents/MacOS/$camino_binary\n");
|
||||
$post_status = 'busted';
|
||||
} else {
|
||||
$post_status = 'success';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Tests...
|
||||
#
|
||||
|
||||
# Clean profile out, if set.
|
||||
# Assume Camino always uses ~/Library/Application Support/Chimera/Profiles/default for now.
|
||||
if ($camino_clean_profile) {
|
||||
# Warning: workaround camino bug, delete whole Camino dir.
|
||||
my $chim_profile_dir = "$ENV{HOME}/Library/Application Support/Chimera";
|
||||
#my $chim_profile_dir = "$ENV{HOME}/Library/Application Support/Chimera/Profiles/default";
|
||||
|
||||
TinderUtils::print_log("Deleting $chim_profile_dir...\n");
|
||||
print "Deleting $chim_profile_dir...\n";
|
||||
File::Path::rmtree([$chim_profile_dir], 0, 0);
|
||||
|
||||
if (-e "$chim_profile_dir") {
|
||||
TinderUtils::print_log("Error: rmtree('$chim_profile_dir') failed\n");
|
||||
}
|
||||
|
||||
# Re-create profile. We have no -CreateProfile, so we instead
|
||||
# run the AliveTest first.
|
||||
}
|
||||
|
||||
# AliveTest for camino, about:blank
|
||||
if ($camino_alive_test and $post_status eq 'success') {
|
||||
|
||||
$post_status = TinderUtils::AliveTest("CaminoAliveTest",
|
||||
"$camino_dir/build/Camino.app/Contents/MacOS",
|
||||
["Camino", "-url", "about:blank"],
|
||||
45);
|
||||
}
|
||||
|
||||
# Find the prefs file, remember we have the secret/random salt dir,
|
||||
# e.g. /Users/cltbld/Library/Application Support/Chimera/Profiles/default/dyrs1ar8.slt/prefs.js
|
||||
# so File::Path::find will find the prefs.js file.
|
||||
#
|
||||
my $pref_file = "prefs.js";
|
||||
my $start_dir = "/Users/cltbld/Library/Application Support/Chimera/Profiles/default";
|
||||
my $found = undef;
|
||||
my $sub = sub {$pref_file = $File::Find::name, $found++ if $pref_file eq $_};
|
||||
|
||||
File::Find::find($sub, $start_dir); # Find prefs.js, write this to $pref_file.
|
||||
|
||||
# Set up performance prefs.
|
||||
if ($pref_file and ($camino_layout_performance_test or 1)) {
|
||||
|
||||
# Some tests need browser.dom.window.dump.enabled set to true, so
|
||||
# that JS dump() will work in optimized builds.
|
||||
if (system("\\grep -s browser.dom.window.dump.enabled $pref_file > /dev/null")) {
|
||||
TinderUtils::print_log("Setting browser.dom.window.dump.enabled\n");
|
||||
open PREFS, ">>$pref_file" or die "can't open $pref_file ($?)\n";
|
||||
print PREFS "user_pref(\"browser.dom.window.dump.enabled\", true);\n";
|
||||
close PREFS;
|
||||
} else {
|
||||
TinderUtils::print_log("Already set browser.dom.window.dump.enabled\n");
|
||||
}
|
||||
|
||||
# Set security prefs to allow us to close our own window,
|
||||
# pageloader test (and possibly other tests) needs this on.
|
||||
if (system("\\grep -s dom.allow_scripts_to_close_windows $pref_file > /dev/null")) {
|
||||
TinderUtils::print_log("Setting dom.allow_scripts_to_close_windows to true.\n");
|
||||
open PREFS, ">>$pref_file" or die "can't open $pref_file ($?)\n";
|
||||
print PREFS "user_pref(\"dom.allow_scripts_to_close_windows\", true);\n";
|
||||
close PREFS;
|
||||
} else {
|
||||
TinderUtils::print_log("Already set dom.allow_scripts_to_close_windows\n");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
# LayoutTest8
|
||||
# resource:///res/samples/test8.html
|
||||
if ($camino_test8_test and $post_status eq 'success') {
|
||||
|
||||
if(0) {
|
||||
open STDOUT, ">/tmp/foo";
|
||||
open STDERR, ">&/tmp/foo";
|
||||
select STDOUT; $| = 1; # make STDOUT unbuffered
|
||||
select STDERR; $| = 1; # make STDERR unbuffered
|
||||
print STDERR "hello, world\n";
|
||||
chdir("$camino_dir/build/Camino.app/Contents/MacOS");
|
||||
exec "./Camino -url \"http://lxr.mozilla.org/seamonkey/source/webshell/tests/viewer/samples/test8.html\"";
|
||||
#exec "foo";
|
||||
} else {
|
||||
$post_status = TinderUtils::AliveTest("CaminoLayoutTest8Test",
|
||||
"$camino_dir/build/Camino.app/Contents/MacOS",
|
||||
["Camino", "-url", "http://lxr.mozilla.org/seamonkey/source/webshell/tests/viewer/samples/test8.html"],
|
||||
20);
|
||||
}
|
||||
}
|
||||
|
||||
# Pageload test.
|
||||
if ($camino_layout_performance_test and $post_status eq 'success') {
|
||||
|
||||
$post_status =
|
||||
TinderUtils::LayoutPerformanceTest("CaminoLayoutPerformanceTest",
|
||||
"$camino_dir/build/Camino.app/Contents/MacOS",
|
||||
["Camino", "-url"]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Pageload test -- Safari.
|
||||
if ($safari_layout_performance_test) {
|
||||
|
||||
TinderUtils::run_system_cmd("/Applications/Utilities/Safari.app/Contents/MacOS/Safari-wrap.pl http://$Settings::pageload_server/page-loader/loader.pl?delay=1000%26nocache=0%26maxcyc=4%26timeout=$Settings::LayoutPerformanceTestPageTimeout%26auto=1", 30);
|
||||
|
||||
# This is a hack.
|
||||
TinderUtils::run_system_cmd("sync; sleep 400", 405);
|
||||
|
||||
TinderUtils::run_system_cmd("/Applications/Utilities/Safari.app/Contents/MacOS/Safari-wrap.pl quit", 30);
|
||||
|
||||
TinderUtils::print_log "TinderboxPrint:" .
|
||||
"<a title=\"Avg of the median per url pageload time\" href=\"http://$Settings::results_server/graph/query.cgi?testname=pageload&tbox=" . ::hostname() . "-aux&autoscale=1&days=7&avg=1\">~Tp" . "</a>\n";
|
||||
|
||||
}
|
||||
|
||||
# Startup test.
|
||||
if ($camino_startup_test and $post_status eq 'success') {
|
||||
$post_status =
|
||||
TinderUtils::StartupPerformanceTest("CaminoStartupPerformanceTest",
|
||||
"Camino",
|
||||
"$camino_dir/build/Camino.app/Contents/MacOS",
|
||||
["-url"],
|
||||
"file:$camino_dir/../../../startup-test.html");
|
||||
}
|
||||
|
||||
if ($camino_window_leaks_test and $post_status eq 'success') {
|
||||
$post_status = CaminoWindowLeaksTest("CaminoWindowLeakTest",
|
||||
"$camino_dir/build/Camino.app/Contents/MacOS/",
|
||||
"./Camino",
|
||||
"-url \"http://www.mozilla.org\"",
|
||||
20);
|
||||
|
||||
}
|
||||
|
||||
# Pass our status back to calling script.
|
||||
return $post_status;
|
||||
}
|
||||
|
||||
# Need to end with a true value, (since we're using "require").
|
||||
1;
|
||||
148
mozilla/tools/tinderbox/build-galeon.pl
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
#
|
||||
# This script gets called after a full mozilla build & test.
|
||||
# Use this to build and test an embedded or commercial branding of Mozilla.
|
||||
#
|
||||
# ./build-seamonkey-utils.pl will call PostMozilla::main() after
|
||||
# a successful build and testing of mozilla. This package can report
|
||||
# status via the $TinderUtils::build_status variable. Yeah this is a hack,
|
||||
# but it works for now. Feel free to improve this mechanism to properly
|
||||
# return values & stuff. -mcafee
|
||||
#
|
||||
# Things to do:
|
||||
# * Get pull by branch working
|
||||
#
|
||||
#
|
||||
use strict;
|
||||
|
||||
package PostMozilla;
|
||||
|
||||
sub checkout {
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
# chdir to build directory
|
||||
chdir "$mozilla_build_dir";
|
||||
|
||||
# Hack to get around po/ChangeLog cvs conflict bug in gettext lib.
|
||||
my $status = TinderUtils::run_shell_command("\\rm -f galeon/po/ChangeLog");
|
||||
|
||||
# Checkout galeon source. First set up cvsroot:
|
||||
# Both of these as of 10/2001 are kinda flakey:
|
||||
# $ENV{CVSROOT} = ":pserver:anonymous\@anoncvs.gnome.org:/cvs/gnome";
|
||||
# $ENV{CVSROOT} = ":pserver:anonymous@cvs.galeon.sourceforge.net:/cvsroot/galeon";
|
||||
#
|
||||
# Asked for direct cvs access and got it:
|
||||
$ENV{CVSROOT} = ":pserver:mcafee\@cvs.gnome.org:/cvs/gnome";
|
||||
|
||||
# Next, actually do the checkout:
|
||||
my $status = TinderUtils::run_shell_command("$Settings::CVS checkout galeon");
|
||||
|
||||
# hack in the galeon prefs, if needed
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
sub main {
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
TinderUtils::print_log "Post-Mozilla build goes here.\n";
|
||||
|
||||
# Pending a config file, stuff things here.
|
||||
my $post_status = 'success'; # Success until we report a failure.
|
||||
my $status = 0; # 0 = success
|
||||
my $galeon_alive_test = 1;
|
||||
my $galeon_test8_test = 1;
|
||||
my $galeon_dir = "$mozilla_build_dir/galeon";
|
||||
my $galeon_binary = "galeon-bin";
|
||||
|
||||
# Checkout/update the galeon code.
|
||||
$status = checkout($mozilla_build_dir);
|
||||
TinderUtils::print_log "Status from checkout: $status\n";
|
||||
if ($status != 0) {
|
||||
$post_status = 'busted';
|
||||
}
|
||||
|
||||
# Build galeon if we passed the checkout command.
|
||||
if ($post_status ne 'busted') {
|
||||
# Build galeon.
|
||||
|
||||
chdir $galeon_dir;
|
||||
|
||||
# Make sure we have a configure
|
||||
unless (-e "configure" and $post_status ne 'busted') {
|
||||
$status = TinderUtils::run_shell_command("./autogen.sh");
|
||||
TinderUtils::print_log "Status from autogen: $status\n";
|
||||
}
|
||||
|
||||
# Not sure how to only do this when we need to.
|
||||
# Force a configure for now.
|
||||
if ($status == 0) {
|
||||
TinderUtils::print_log "configuring...\n";
|
||||
$status = TinderUtils::run_shell_command("./configure --sysconfdir=/etc --with-mozilla-libs=$mozilla_build_dir/mozilla/dist/bin --with-mozilla-includes=$mozilla_build_dir/mozilla/dist/include --with-nspr-includes=$mozilla_build_dir/mozilla/dist/include/nspr --with-mozilla-home=$mozilla_build_dir/mozilla/dist/bin");
|
||||
TinderUtils::print_log "Status from configure: $status\n";
|
||||
}
|
||||
|
||||
if ($status == 0) {
|
||||
TinderUtils::print_log "Deleting, gmake...\n";
|
||||
TinderUtils::DeleteBinary("$galeon_dir/src/$galeon_binary");
|
||||
|
||||
my $foo = Cwd::getcwd();
|
||||
TinderUtils::print_log "cwd = $foo\n";
|
||||
$status = TinderUtils::run_shell_command("gmake");
|
||||
TinderUtils::print_log "Status from gmake: $status\n";
|
||||
}
|
||||
|
||||
TinderUtils::print_log "Testing build status...\n";
|
||||
if ($status != 0) {
|
||||
TinderUtils::print_log "busted, gmake status non-zero\n";
|
||||
$post_status = 'busted';
|
||||
} elsif (not TinderUtils::BinaryExists("$galeon_dir/src/$galeon_binary")) {
|
||||
TinderUtils::print_log "Error: binary not found: $galeon_dir/src/$galeon_binary\n";
|
||||
$post_status = 'busted';
|
||||
} else {
|
||||
$post_status = 'success';
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Need a way to bypass initial setup dialog stuff, or
|
||||
# we'll need to manually run this by hand the first time.
|
||||
#
|
||||
# Also, have to set crash_recovery=0 in ~/.gnome/galeon to avoid
|
||||
# getting the crash dialog after the alive test times out.
|
||||
#
|
||||
|
||||
# Test galeon, about:blank
|
||||
if ($galeon_alive_test and $post_status eq 'success') {
|
||||
$post_status = TinderUtils::AliveTest("GaleonAliveTest",
|
||||
"$galeon_dir/src",
|
||||
["galeon", "about:blank"],
|
||||
45);
|
||||
}
|
||||
|
||||
# Test galeon, test8
|
||||
if ($galeon_test8_test and $post_status eq 'success') {
|
||||
$post_status = TinderUtils::AliveTest("GaleonTest8Test",
|
||||
"$galeon_dir/src",
|
||||
["galeon", "resource:///res/samples/test8.html"],
|
||||
45);
|
||||
}
|
||||
|
||||
# Startup test
|
||||
if ($galeon_startup_test and $post_status eq 'success') {
|
||||
TinderUtils::StartupPerformanceTest("GaleonStartupPerformanceTest",
|
||||
"galeon",
|
||||
"$galeon_dir/src",
|
||||
["", "$galeon_dir/src/../../../startup-test.html"]);
|
||||
|
||||
}
|
||||
|
||||
# Pass our status back to calling script.
|
||||
return $post_status;
|
||||
}
|
||||
|
||||
# Need to end with a true value, (since we're using "require").
|
||||
1;
|
||||
2666
mozilla/tools/tinderbox/build-seamonkey-util.pl
Normal file
338
mozilla/tools/tinderbox/build-seamonkey-win32.pl
Normal file
@@ -0,0 +1,338 @@
|
||||
|
||||
#!d:/nstools/bin/perl5
|
||||
|
||||
use Cwd;
|
||||
|
||||
$build_depend=1; #depend or clobber
|
||||
$build_tree = '';
|
||||
$build_tag = '';
|
||||
$build_name = '';
|
||||
$build_continue = 0;
|
||||
$build_sleep=10;
|
||||
$no32 = 0;
|
||||
$original_path = $ENV{'PATH'};
|
||||
$early_exit = 1;
|
||||
$doawt11 = 0;
|
||||
|
||||
$do_clobber = '';
|
||||
$client_param = '';
|
||||
|
||||
&parse_args;
|
||||
|
||||
if( $build_test ){
|
||||
$build_sleep=1;
|
||||
}
|
||||
|
||||
$dirname = ($build_depend?'dep':'clob');
|
||||
|
||||
|
||||
$logfile = "${dirname}.log";
|
||||
|
||||
if( $build_depend ){
|
||||
$clobber_str = 'depend';
|
||||
}
|
||||
else {
|
||||
$clobber_str = 'clobber_all';
|
||||
}
|
||||
|
||||
|
||||
mkdir("$dirname", 0777);
|
||||
chdir("$dirname") || die "couldn't cd to $dirname";
|
||||
|
||||
$start_dir = cwd;
|
||||
$start_dir =~ s/\//\\/ ;
|
||||
$last_time = 0;
|
||||
|
||||
print "starting dir is: $start_dir\n";
|
||||
|
||||
while( $early_exit ){
|
||||
chdir("$start_dir");
|
||||
if( time - $last_time < (60 * $build_sleep) ){
|
||||
$sleep_time = (60 * $build_sleep) - (time - $last_time);
|
||||
print "\n\nSleeping $sleep_time seconds ...\n";
|
||||
sleep( $sleep_time );
|
||||
}
|
||||
$last_time = time;
|
||||
|
||||
$start_time = time;
|
||||
$start_time = adjust_start_time($start_time);
|
||||
$start_time_str = `unix_date +"%m/%d/%Y %H:%M"`;
|
||||
chop($start_time_str);
|
||||
# call setup_env here in the loop, to update MOZ_DATE with each pass.
|
||||
# setup_env uses start_time_str for MOZ_DATE.
|
||||
&setup_env;
|
||||
|
||||
$cur_dir = cwd;
|
||||
$cur_dir =~ s/\//\\/ ;
|
||||
|
||||
if( $cur_dir ne $start_dir ){
|
||||
print "startdir: $start_dir, curdir $cur_dir\n";
|
||||
die "curdir != startdir";
|
||||
}
|
||||
|
||||
if ($build_test) {
|
||||
$early_exit = 0; # stops this while loop after one pass.
|
||||
}
|
||||
|
||||
# strip_conf fails to strip any variables from the real environemnt
|
||||
# &strip_config;
|
||||
&do_build(1,$do_clobber);
|
||||
# &restore_config;
|
||||
|
||||
}
|
||||
|
||||
sub setup32 {
|
||||
local ($awt) = @_;
|
||||
|
||||
$ENV{"MOZ_BITS"} = '32';
|
||||
$ENV{"WINOS"} = 'WINNT';
|
||||
$ENV{"STANDALONE_IMAGE_LIB"} = '1';
|
||||
$ENV{"MODULAR_NETLIB"} = '1';
|
||||
$ENV{"OS_TARGET"} = 'WIN95';
|
||||
$ENV{"PATH"} = $original_path;
|
||||
$ENV{"_MSC_VER"} = '1200';
|
||||
$moz_src = $ENV{'MOZ_SRC'} = $start_dir;
|
||||
$build_name = 'Win32 VC6.0' . ($build_depend?'Depend':'Clobber');
|
||||
$do_clobber = $clobber_str;
|
||||
$logname = "win32.log";
|
||||
}
|
||||
|
||||
|
||||
sub do_build {
|
||||
local ($pull, $do_clobber) = @_;
|
||||
|
||||
print "pull = $pull, do_clobber = $do_clobber\n";
|
||||
&start_build;
|
||||
|
||||
print "opening log file ${logname}\n";
|
||||
open( LOG, ">${logname}" ) || print "can't open $logname\n";
|
||||
print LOG "current dir is: $cur_dir\n";
|
||||
|
||||
&print_env;
|
||||
$build_status = 0;
|
||||
if( $pull ){
|
||||
if ( $build_tag eq '' ){
|
||||
# print LOG "cvs -d %MOZ_CVSROOT% co -A mozilla/config 2>&1 |\n";
|
||||
# open( PULL, "cvs -d %MOZ_CVSROOT% co -A mozilla/config 2>&1 |") || print "couldn't execute cvs\n";;
|
||||
print LOG "cvs -d $moz_cvsroot co -A mozilla/client.mak 2>&1 |\n";
|
||||
open( PULL, "cvs -d $moz_cvsroot co -A mozilla/client.mak 2>&1 |") || print "couldn't execute cvs\n";;
|
||||
} else{
|
||||
print LOG "cvs -d $moz_cvsroot co -A -r $build_tag mozilla/config 2>&1 |\n";
|
||||
open( PULL, "cvs -d $moz_cvsroot co -A -r $build_tag mozilla/config 2>&1 |") || print "couldn't execute cvs\n";;
|
||||
print LOG "cvs -d $moz_cvsroot co -A -r $build_tag mozilla/client.mak 2>&1 |\n";
|
||||
open( PULL, "cvs -d $moz_cvsroot co -A -r $build_tag mozilla/client.mak 2>&1 |") || print "couldn't execute cvs\n";;
|
||||
}
|
||||
|
||||
# tee the output
|
||||
while( <PULL> ){
|
||||
print $_;
|
||||
print LOG $_;
|
||||
}
|
||||
close( PULL );
|
||||
|
||||
$build_status = $?;
|
||||
}
|
||||
|
||||
chdir("$moz_src/mozilla") || die "couldn't chdir to '$moz_src/mozilla'";
|
||||
|
||||
# if( $do_clobber ne '' ){
|
||||
# print LOG "nmake -f client.mak $do_clobber |\n";
|
||||
# print "nmake -f client.mak $do_clobber |\n";
|
||||
# open( CLOBBER, "nmake -f client.mak $do_clobber 2>&1 |") || print "couldn't execute nmake\n";;
|
||||
|
||||
# tee the output
|
||||
# while( <CLOBBER> ){
|
||||
# print $_;
|
||||
# print LOG $_;
|
||||
# }
|
||||
# close( CLOBBER );
|
||||
# }
|
||||
|
||||
|
||||
if (!$pull) {
|
||||
$client_param = $do_clobber . ' build_all';
|
||||
}
|
||||
else {
|
||||
$client_param = 'pull_all ' . $do_clobber . ' build_all';
|
||||
}
|
||||
|
||||
print LOG "nmake -f client.mak $client_param 2>&1 |\n";
|
||||
open( BUILD, "nmake -f client.mak $client_param 2>&1 |");
|
||||
|
||||
# tee the output
|
||||
while( <BUILD> ){
|
||||
print $_;
|
||||
print LOG $_;
|
||||
}
|
||||
close( BUILD );
|
||||
$build_status |= $?;
|
||||
$build_status_str = ( $build_status ? 'busted' : 'success' );
|
||||
|
||||
print LOG "\n";
|
||||
print LOG "tinderbox: tree: $build_tree\n";
|
||||
print LOG "tinderbox: builddate: $start_time\n";
|
||||
print LOG "tinderbox: status: $build_status_str\n";
|
||||
print LOG "tinderbox: build: $build_name\n";
|
||||
print LOG "tinderbox: errorparser: windows\n";
|
||||
print LOG "tinderbox: buildfamily: windows\n";
|
||||
|
||||
close( LOG );
|
||||
chdir("$start_dir");
|
||||
system( "$nstools\\bin\\blat ${logname} -t tinderbox-daemon\@cvs-mirror.mozilla.org" );
|
||||
|
||||
# we should save at least one log back
|
||||
system("copy ${logname} last-${logname}");
|
||||
}
|
||||
|
||||
sub cvs_time {
|
||||
local( $ret_time );
|
||||
|
||||
($sec,$minute,$hour,$mday,$mon,$year) = localtime( $_[0] );
|
||||
$mon++; # month is 0 based.
|
||||
|
||||
sprintf("%02d/%02d/%04d %02d:%02d:00",
|
||||
$mon,$mday,$year,$hour,$minute );
|
||||
}
|
||||
|
||||
|
||||
sub start_build {
|
||||
open( LOG, ">logfile" );
|
||||
print LOG "\n";
|
||||
print LOG "tinderbox: tree: $build_tree\n";
|
||||
print LOG "tinderbox: builddate: $start_time\n";
|
||||
print LOG "tinderbox: status: building\n";
|
||||
print LOG "tinderbox: build: $build_name\n";
|
||||
print LOG "tinderbox: errorparser: windows\n";
|
||||
print LOG "tinderbox: buildfamily: windows\n";
|
||||
print LOG "\n";
|
||||
close( LOG );
|
||||
system("$nstools\\bin\\blat logfile -t tinderbox-daemon\@cvs-mirror.mozilla.org" );
|
||||
}
|
||||
|
||||
sub parse_args {
|
||||
local($i);
|
||||
|
||||
if( @ARGV == 0 ){
|
||||
&usage;
|
||||
}
|
||||
$i = 0;
|
||||
while( $i < @ARGV ){
|
||||
if( $ARGV[$i] eq '--depend' ){
|
||||
$build_depend = 1;
|
||||
}
|
||||
elsif ( $ARGV[$i] eq '--clobber' ){
|
||||
$build_depend = 0;
|
||||
}
|
||||
elsif ( $ARGV[$i] eq '--continue' ){
|
||||
$build_continue = 1;
|
||||
}
|
||||
elsif ( $ARGV[$i] eq '--test' ){
|
||||
$build_test = 1;
|
||||
}
|
||||
elsif ( $ARGV[$i] eq '-tag' ){
|
||||
$i++;
|
||||
$build_tag = $ARGV[$i];
|
||||
if( $build_tag eq '' || $build_tag eq '-t'){
|
||||
&usage;
|
||||
}
|
||||
}
|
||||
elsif ( $ARGV[$i] eq '-t' ){
|
||||
$i++;
|
||||
$build_tree = $ARGV[$i];
|
||||
if( $build_tree eq '' ){
|
||||
&usage;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if( $build_tree eq '' ){
|
||||
&usage;
|
||||
}
|
||||
}
|
||||
|
||||
sub usage {
|
||||
die "usage: buildit.pl [--depend | --clobber] [--continue] [--test] [-tag TAGNAME] -t TREENAME\n";
|
||||
}
|
||||
|
||||
sub setup_env {
|
||||
local($p);
|
||||
|
||||
# $ENV{"MOZ_DEBUG"} = '1';
|
||||
$ENV{"MOZ_MFC"} = '1';
|
||||
$ENV{"CVSROOT"} = ':pserver:cltbld%netscape.com@cvs.mozilla.org:/cvsroot';
|
||||
$moz_cvsroot = $ENV{"CVSROOT"};
|
||||
# $ENV{"MOZ_EDITOR"} = '1';
|
||||
$ENV{"VERBOSE"} = '1';
|
||||
$ENV{"NGLAYOUT_PLUGINS"} = '1';
|
||||
$nstools = $ENV{"MOZ_TOOLS"};
|
||||
if( $nstools eq '' ){
|
||||
print "warning: environment variable MOZ_TOOLS not set\n";
|
||||
$ENV{"MOZ_TOOLS"} = 'C:\nstools';
|
||||
$nstools = $ENV{"MOZ_TOOLS"};
|
||||
print "using MOZ_TOOLS = $nstools \n";
|
||||
|
||||
}
|
||||
# $msdev = $ENV{"MOZ_MSDEV"} = 'c:\msdev';
|
||||
# if( $msdev eq '' ){
|
||||
# die "error: environment variable MOZ_MSDEV not set\n";
|
||||
# }
|
||||
# $msvc = $ENV{"MOZ_MSVC"} = 'c:\msvc';
|
||||
# if( $msvc eq '' ){
|
||||
# die "error: environment variable MOZ_VC not set\n";
|
||||
# }
|
||||
if ( $build_tag ne '' ) {
|
||||
$ENV{"MOZ_BRANCH"} = $build_tag;
|
||||
}
|
||||
$moz_src = $ENV{"MOZ_SRC"} = $start_dir;
|
||||
# $ENV{"INCLUDE"}='c:\devstudio\vc\lib;C:\DevStudio\VC\INCLUDE;C:\DevStudio\VC\MFC\INCLUDE;C:\DevStudio\VC\lib;C:\DevStudio\VC\ATL\INCLUDE';
|
||||
# $ENV{"LIB"}='C:\DevStudio\VC\MFC\LIB;C:\DevStudio\VC\lib';
|
||||
# $ENV{"PATH"}='C:\DevStudio\SharedIDE\BIN;C:\DevStudio\VC\bin;C:\DevStudio\VC\lib;C:\DevStudio\VC\BIN\WINNT;.;%MOZ_TOOLS%\perl5\bin;C:\WINNT\system32;C:\WINNT;c:\usr\local\bin;%MOZ_TOOLS%\bin';
|
||||
##
|
||||
## We should pull by date to avoid mid-checkin disasters
|
||||
##
|
||||
$ENV{"MOZ_DATE"} = $start_time_str;
|
||||
|
||||
&setup32
|
||||
}
|
||||
|
||||
sub print_env {
|
||||
local( $k, $v);
|
||||
print LOG "\nEnvironment\n";
|
||||
print "\nEnvironment\n";
|
||||
for $k (sort keys %ENV){
|
||||
$v = $ENV{$k};
|
||||
print LOG " $k=$v\n";
|
||||
print " $k=$v\n";
|
||||
}
|
||||
print LOG "\n";
|
||||
print "\n";
|
||||
system 'set';
|
||||
}
|
||||
|
||||
sub strip_config {
|
||||
$save_compname=$ENV{"COMPUTERNAME"};
|
||||
$save_userdomain=$ENV{"USERDOMAIN"};
|
||||
$save_username=$ENV{"USERNAME"};
|
||||
$save_userprofile=$ENV{"USERPROFILE"};
|
||||
}
|
||||
|
||||
sub restore_config {
|
||||
$ENV{"COMPUTERNAME"}=$save_compname;
|
||||
$ENV{"USERDOMAIN"}=$save_userdomain;
|
||||
$ENV{"USERNAME"}=$save_username;
|
||||
$ENV{"MSDevDir"}=$save_userprofile;
|
||||
&print_env;
|
||||
}
|
||||
|
||||
sub adjust_start_time {
|
||||
# Allows the start time to match up with the update times of a mirror.
|
||||
my ($start_time) = @_;
|
||||
|
||||
# Since we are not pulling for cvs-mirror anymore, just round times
|
||||
# to 1 minute intervals to make them nice and even.
|
||||
my $cycle = 1 * 60; # Updates every 1 minutes.
|
||||
my $begin = 0 * 60; # Starts 0 minutes after the hour.
|
||||
my $lag = 0 * 60; # Takes 0 minute to update.
|
||||
return int(($start_time - $begin - $lag) / $cycle) * $cycle + $begin;
|
||||
}
|
||||
|
||||
36
mozilla/tools/tinderbox/build-seamonkey.pl
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
require 5.003;
|
||||
|
||||
# This script has split some functions off into a util
|
||||
# script so they can be re-used by other scripts.
|
||||
require "build-seamonkey-util.pl";
|
||||
|
||||
use strict;
|
||||
|
||||
# "use strict" complains if we do not define these.
|
||||
# They are not initialized here. The default values are after "__END__".
|
||||
$TreeSpecific::name = $TreeSpecific::checkout_target = $TreeSpecific::checkout_clobber_target = $::Version = undef;
|
||||
|
||||
$::Version = '$Revision: 1.100 $ ';
|
||||
|
||||
{
|
||||
TinderUtils::Setup();
|
||||
tree_specific_overides();
|
||||
TinderUtils::Build();
|
||||
}
|
||||
|
||||
# End of main
|
||||
#======================================================================
|
||||
|
||||
|
||||
|
||||
sub tree_specific_overides {
|
||||
|
||||
$TreeSpecific::name = 'mozilla';
|
||||
$TreeSpecific::checkout_target = '';
|
||||
$TreeSpecific::checkout_clobber_target = "checkout realclean build";
|
||||
|
||||
}
|
||||
|
||||
|
||||
18
mozilla/tools/tinderbox/examples/mozconfig
Normal file
@@ -0,0 +1,18 @@
|
||||
# Turning on security
|
||||
#
|
||||
ac_add_options --enable-crypto
|
||||
#
|
||||
# Add all extensions
|
||||
#
|
||||
ac_add_options --enable-extensions=all
|
||||
#
|
||||
# Optimized
|
||||
#
|
||||
ac_add_options --enable-optimize
|
||||
ac_add_options --disable-debug
|
||||
#
|
||||
# Bloat stats/optimized needs these:
|
||||
#
|
||||
#ac_add_options --enable-logrefcnt
|
||||
#ac_add_options --enable-perf-metrics
|
||||
#
|
||||
38
mozilla/tools/tinderbox/examples/tinder-config.pl
Normal file
@@ -0,0 +1,38 @@
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = 'mcafee@mocha.com';
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
$DisplayServer = ':0.0'; # costarica:0.0
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
$BuildTree = 'MozillaTest';
|
||||
#$BuildTree = 'SeaMonkey';
|
||||
|
||||
$AliveTest = 1;
|
||||
$ViewerTest = 0;
|
||||
$BloatTest = 0;
|
||||
$BloatTest2 = 0;
|
||||
$DomToTextConversionTest = 0;
|
||||
$EmbedTest = 0;
|
||||
$MailNewsTest = 0;
|
||||
$LayoutPerformanceTest = 0;
|
||||
$StartupPerformanceTest = 0;
|
||||
|
||||
$MozProfileName = "default";
|
||||
$BloatTestTimeout = 240; # seconds
|
||||
$LayoutPerformanceTestTimeout = 1400; # seconds
|
||||
$StartupPerformanceTestTimeout = 60; # seconds
|
||||
|
||||
# Testing...
|
||||
# $TestOnly = 1;
|
||||
# $ObjDir = 'obj-i686-unknown-linux-gnu';
|
||||
|
||||
$UserComment = "Sample tinder-config.pl, changeme!";
|
||||
|
||||
# Need to end with a true value
|
||||
1;
|
||||
63
mozilla/tools/tinderbox/examples/tinder-config.pl.branch
Normal file
@@ -0,0 +1,63 @@
|
||||
#- tinder-config.pl - Tinderbox configuration file.
|
||||
#- Uncomment the variables you need to set.
|
||||
#- The default values are the same as the commented variables.
|
||||
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
$BuildAdministrator = "mcafee\@netscape.com";
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
$DisplayServer = 'costarica.mcom.com:0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
$BuildDepend = 1; # Depend or Clobber
|
||||
$ReportStatus = 1; # Send results to server, or not
|
||||
$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
$UseTimeStamp = 0; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
#$BuildOnce = 0; # Build once, don't send results to server
|
||||
#$RunTest = 1; # Run the smoke tests on successful build, or not
|
||||
#$TestOnly = 0; # Only run tests, don't pull/build
|
||||
|
||||
# Tests
|
||||
$AliveTest = 1;
|
||||
$ViewerTest = 1;
|
||||
$BloatTest = 1;
|
||||
$DomToTextConversionTest = 1;
|
||||
$MailNewsTest = 0;
|
||||
#$MozConfigFileName = 'mozconfig';
|
||||
#$MozProfileName = 'default';
|
||||
$BloatTestTimeout = 240;
|
||||
$DomTestTimeout = 45;
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'gmake'; # Must be GNU make
|
||||
#$MakeOverrides = '';
|
||||
$mail = '/bin/mail';
|
||||
$CVS = 'cvs -q';
|
||||
$CVSCO = 'checkout -P';
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
#$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
$BuildTree = 'SeaMonkey-Branch';
|
||||
|
||||
#$BuildName = '';
|
||||
$BuildTag = 'MOZILLA_0_9_1_BRANCH';
|
||||
#$BuildConfigDir = 'mozilla/config';
|
||||
#$Topsrcdir = 'mozilla';
|
||||
#$BinaryName = 'mozilla-bin';
|
||||
#$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
#$ConfigureArgs = '';
|
||||
#$ConfigureEnvArgs = '';
|
||||
#$Compiler = 'gcc';
|
||||
#$NSPRArgs = '';
|
||||
#$ShellOverride = '';
|
||||
73
mozilla/tools/tinderbox/gettime.pl
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Use high resolution routines if installed (on win32 or linux), using
|
||||
# eval as try/catch block around import of modules. Otherwise, just use 'time()'.
|
||||
#
|
||||
# 'Win32::API' <http://www.activestate.com/PPMPackages/zips/5xx-builds-only/Win32-API.zip>
|
||||
# 'Time::HiRes' <http://search.cpan.org/search?dist=Time-HiRes>
|
||||
# (also: http://rpmfind.net/linux/rpm2html/search.php?query=perl-Time-HiRes)
|
||||
#
|
||||
package Time::PossiblyHiRes;
|
||||
|
||||
use strict;
|
||||
|
||||
#use Time::HiRes qw(gettimeofday);
|
||||
|
||||
my $getLocalTime; # for win32
|
||||
my $lpSystemTime = pack("SSSSSSSS"); # for win32
|
||||
my $timesub; # code ref
|
||||
|
||||
# returns 12 char string "'s'x9.'m'x3" which is milliseconds since epoch,
|
||||
# although resolution may vary depending on OS and installed packages
|
||||
|
||||
sub getTime () {
|
||||
|
||||
return &$timesub
|
||||
if $timesub;
|
||||
|
||||
$timesub = sub { time() . "000"; }; # default
|
||||
|
||||
return &$timesub
|
||||
if $^O eq "MacOS"; # don't know a better way on Mac
|
||||
|
||||
if ($^O eq "MSWin32") {
|
||||
eval "use Win32::API;";
|
||||
$timesub = sub {
|
||||
# pass pointer to struct, void return
|
||||
$getLocalTime =
|
||||
eval "new Win32::API('kernel32', 'GetLocalTime', [qw{P}], qw{V});"
|
||||
unless $getLocalTime;
|
||||
$getLocalTime->Call($lpSystemTime);
|
||||
my @t = unpack("SSSSSSSS", $lpSystemTime);
|
||||
sprintf("%9s%03s", time(), pop @t);
|
||||
} if !$@;
|
||||
}
|
||||
|
||||
# ass-u-me if not mac/win32, then we're on a unix flavour
|
||||
else {
|
||||
eval "use Time::HiRes qw(gettimeofday);";
|
||||
$timesub = sub {
|
||||
my @t = gettimeofday();
|
||||
$t[0]*1000 + int($t[1]/1000);
|
||||
} if !$@;
|
||||
}
|
||||
|
||||
return &$timesub;
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
#
|
||||
# Test script to compare with low-res time:
|
||||
#
|
||||
# require "gettime.pl";
|
||||
#
|
||||
# use POSIX qw(strftime);
|
||||
#
|
||||
# print "hires time = " . Time::PossiblyHiRes::getTime() . "\n";
|
||||
# print "lowres time = " . time() . "\n";
|
||||
#
|
||||
|
||||
|
||||
# end package
|
||||
1;
|
||||
14
mozilla/tools/tinderbox/install-links
Executable file
@@ -0,0 +1,14 @@
|
||||
#! /bin/csh -f
|
||||
|
||||
#
|
||||
# Create links to install tinderbox stuff.
|
||||
#
|
||||
|
||||
ln -s ../mozilla/tools/tinderbox/tinderbox
|
||||
ln -s ../mozilla/tools/tinderbox/build-seamonkey.pl
|
||||
ln -s ../mozilla/tools/tinderbox/build-seamonkey-util.pl
|
||||
ln -s ../mozilla/tools/tinderbox/gettime.pl
|
||||
ln -s ../mozilla/tools/tinderbox/bloatdiff.pl
|
||||
ln -s ../mozilla/tools/tinderbox/tinder-defaults.pl
|
||||
ln -s ../mozilla/tools/tinderbox/reportdata.pl
|
||||
|
||||
75
mozilla/tools/tinderbox/multi-tinderbox.pl
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/perl
|
||||
# vim:sw=4:et:ts=4:ai:
|
||||
|
||||
use strict;
|
||||
|
||||
sub PrintUsage() {
|
||||
die <<END_USAGE
|
||||
usage: $0 [options]
|
||||
Options:
|
||||
--example-config Instead of running, print an example
|
||||
'multi-config.pl' to help get started.
|
||||
END_USAGE
|
||||
}
|
||||
|
||||
sub PrintExample() {
|
||||
print <<END_EXAMPLE
|
||||
# multi-config.pl
|
||||
\$BuildSleep = 10; # minutes
|
||||
\$Tinderboxes = [ { tree => "SeaMonkey", args => "--depend --mozconfig mozconfig" }, { tree => "SeaMonkey-Branch", args => "--depend --mozconfig mozconfig" } ];
|
||||
END_EXAMPLE
|
||||
;
|
||||
exit;
|
||||
}
|
||||
|
||||
sub HandleArgs() {
|
||||
return if ($#ARGV == -1);
|
||||
PrintUsage() if ($#ARGV != 0 || $ARGV[0] ne "--example-config");
|
||||
PrintExample();
|
||||
}
|
||||
|
||||
sub LoadConfig() {
|
||||
if (-r 'multi-config.pl') {
|
||||
no strict 'vars';
|
||||
|
||||
open CONFIG, 'multi-config.pl' or
|
||||
print "can't open multi-config.pl, $?\n";
|
||||
|
||||
while (<CONFIG>) {
|
||||
package Settings;
|
||||
eval;
|
||||
}
|
||||
|
||||
close CONFIG;
|
||||
} else {
|
||||
warn "Error: Need tinderbox config file, multi-config.pl\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub Run() {
|
||||
my $start_time = 0;
|
||||
while (1) {
|
||||
# $BuildSleep is the minimum amount of time a build is allowed to take.
|
||||
# It prevents sending too many messages to the tinderbox server when
|
||||
# something is broken.
|
||||
my $sleep_time = ($Settings::BuildSleep * 60) - (time() - $start_time);
|
||||
if ($sleep_time > 0) {
|
||||
print "\n\nSleeping $sleep_time seconds ...\n";
|
||||
sleep $sleep_time;
|
||||
}
|
||||
$start_time = time();
|
||||
|
||||
foreach my $treeentry (@{$Settings::Tinderboxes}) {
|
||||
chdir($treeentry->{tree}) or
|
||||
die "Tree $treeentry->{tree} does not exist";
|
||||
system("./build-seamonkey.pl --once $treeentry->{args}");
|
||||
chdir("..");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HandleArgs();
|
||||
LoadConfig();
|
||||
Run();
|
||||
179
mozilla/tools/tinderbox/post-mozilla-linux-release.pl
Executable file
@@ -0,0 +1,179 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
#
|
||||
# This script gets called after a full mozilla build & test.
|
||||
# Use this to build and test an embedded or commercial branding of Mozilla.
|
||||
#
|
||||
# Edit, and rename this file to post-mozilla.pl to activate.
|
||||
# ./build-seamonkey-utils.pl will call PostMozilla::main() after
|
||||
# a successful build and testing of mozilla. This package can report
|
||||
# status via the $TinderUtils::build_status variable. Yeah this is a hack,
|
||||
# but it works for now. Feel free to improve this mechanism to properly
|
||||
# return values & stuff. -mcafee
|
||||
#
|
||||
# Contributors:
|
||||
# leaf@mozilla.org - release processing/packaging/uploading
|
||||
|
||||
# Assumptions:
|
||||
# no objdir
|
||||
# ssh-agent running or empty passphrase RSA key
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
package PostMozilla;
|
||||
|
||||
sub print_log {
|
||||
my ($text) = @_;
|
||||
print LOG $text;
|
||||
print $text;
|
||||
}
|
||||
|
||||
# Cache builds in a dated directory if:
|
||||
# * The hour of the day is $Settings::build_hour or higher
|
||||
# (set in tinder-config.pl)
|
||||
# -and-
|
||||
# * the "last-built" file indicates a day before today's date
|
||||
#
|
||||
sub cacheit {
|
||||
my ($c_hour, $c_yday, $target_hour, $last_build_day) = @_;
|
||||
TinderUtils::print_log "current hour = $c_hour\n";
|
||||
TinderUtils::print_log "target hour = $target_hour\n";
|
||||
TinderUtils::print_log "current julian day = $c_yday\n";
|
||||
TinderUtils::print_log "last build julian day = $last_build_day\n";
|
||||
if (($c_hour > $target_hour) &&
|
||||
(($last_build_day < $c_yday) || ($c_yday == 0))) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sub returnStatus{
|
||||
# build-anvil-util.pl expects an array, if no package is uploaded,
|
||||
# a single-element array with 'busted', 'testfailed', or 'success' works.
|
||||
my ($logtext, @status) = @_;
|
||||
TinderUtils::print_log "$logtext\n";
|
||||
return @status;
|
||||
}
|
||||
|
||||
sub pushit {
|
||||
my ($ssh_server,$upload_path,$upload_target) = @_;
|
||||
# need to convert the path in case we're using activestate perl
|
||||
# check for platform
|
||||
#my $upload_target_dos = `cygpath -w $upload_target`;
|
||||
#chop($upload_target_dos);
|
||||
|
||||
unless ( -e $upload_target) {
|
||||
TinderUtils::print_log "No $upload_target to upload\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
#for leaf
|
||||
TinderUtils::run_shell_command "ssh -1 -i /home/leaf/.ssh/cltbld/.ssh/identity -l cltbld $ssh_server mkdir -p $upload_path";
|
||||
TinderUtils::run_shell_command "scp -i /home/leaf/.ssh/cltbld/.ssh/identity -oProtocol=1 -r $upload_target cltbld\@$ssh_server:$upload_path";
|
||||
TinderUtils::run_shell_command "ssh -1 -i /home/leaf/.ssh/cltbld/.ssh/identity -l cltbld $ssh_server chmod -R 755 $upload_path/$upload_target";
|
||||
|
||||
# for cltbld
|
||||
#TinderUtils::run_shell_command "ssh -1 -l cltbld $ssh_server mkdir -p $upload_path";
|
||||
#TinderUtils::run_shell_command "scp -oProtocol=1 $upload_target cltbld\@$ssh_server:$upload_path";
|
||||
#TinderUtils::run_shell_command "ssh -1 -l cltbld $ssh_server chmod -R 755 $upload_path";
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub process_talkback {
|
||||
# this is where we
|
||||
# * generate a master.ini
|
||||
# * upload symbol-files
|
||||
# * shove talkback files into dist for packaging.
|
||||
#
|
||||
|
||||
}
|
||||
|
||||
sub make_packages {
|
||||
my ($build_dir, $build_date) = @_;
|
||||
my $save_dir = `pwd`;
|
||||
|
||||
#DEBUG_LEAF
|
||||
print_log "current directory is $save_dir\n";
|
||||
print_log "cd to $build_dir/$Settings::Topsrcdir/xpinstall\n";
|
||||
#end DEBUG_LEAF
|
||||
|
||||
chdir "$build_dir/$Settings::Topsrcdir/xpinstall";
|
||||
$ENV{"INSTALLER_URL"} = "http://ftp.mozilla.org/pub/mozilla.org/pub/mozilla/tinderbox-builds/$build_date";
|
||||
system "make installer";
|
||||
# if ($DEBUG_LEAF) {
|
||||
print_log "post |make installer|\n";
|
||||
# DEBUG_LEAF
|
||||
chdir $save_dir;
|
||||
|
||||
}
|
||||
|
||||
sub push_to_stage {
|
||||
my ($build_dir, $build_date) = @_;
|
||||
my $save_dir = `pwd`;
|
||||
chdir "$build_dir/$Settings::Topsrcdir/installer";
|
||||
mkdir $build_date;
|
||||
system "cp sea/* $build_date";
|
||||
system "cp stub/* $build_date";
|
||||
system "cp -r raw/xpi $build_date/linux-xpi";
|
||||
pushit ("stage.mozilla.org", "/home/ftp/pub/mozilla/tinderbox-builds", $build_date);
|
||||
chdir $save_dir;
|
||||
|
||||
}
|
||||
|
||||
sub pad_digit {
|
||||
my ($digit) = @_;
|
||||
if ($digit < 10) { return "0" . $digit };
|
||||
return $digit;
|
||||
}
|
||||
|
||||
sub main {
|
||||
# Get build directory from caller.
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
#
|
||||
# (0: $sec, 1: $min, 2: $hour, 3: $mday, 4: $mon, 5: $year,
|
||||
# 6: $wday, 7: $yday, 8: $isdst)
|
||||
my ($hour, $mday, $mon, $year, $yday) = (localtime (time)) [2,3,4,5,7];
|
||||
$year = $year + 1900;
|
||||
$mon = $mon + 1;
|
||||
$hour = pad_digit ($hour);
|
||||
$mday = pad_digit ($mday);
|
||||
$mon = pad_digit ($mon);
|
||||
my $build_date = "$year-$mon-$mday-$hour";
|
||||
#
|
||||
my $last_build_day = -1;
|
||||
if ( -e "$mozilla_build_dir/last-built"){
|
||||
($last_build_day) = (localtime((stat "$mozilla_build_dir/last-built")[9]))[7];
|
||||
}
|
||||
|
||||
print_log "build dir is $mozilla_build_dir \n";
|
||||
TinderUtils::print_log "Post-Mozilla build goes here.\n";
|
||||
|
||||
# someday, we'll have talkback
|
||||
#process_talkback;
|
||||
|
||||
make_packages ($mozilla_build_dir, $build_date);
|
||||
if (cacheit($hour, $yday, "8", $last_build_day)) {
|
||||
push_to_stage ($mozilla_build_dir, $build_date);
|
||||
unlink "$mozilla_build_dir/last-built";
|
||||
open BLAH, ">$mozilla_build_dir/last-built";
|
||||
close BLAH;
|
||||
}
|
||||
|
||||
# Report some kind of status to parent script.
|
||||
#
|
||||
# {'busted', 'testfailed', 'success'}
|
||||
#
|
||||
|
||||
# Report a fake success, for example's sake.
|
||||
# Eventually return an array
|
||||
&returnStatus (('success'));
|
||||
}
|
||||
|
||||
# Need to end with a true value, (since we're using "require").
|
||||
1;
|
||||
46
mozilla/tools/tinderbox/post-mozilla-sample.pl
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
#
|
||||
# This script gets called after a full mozilla build & test.
|
||||
# Use this to build and test an embedded or commercial branding of Mozilla.
|
||||
#
|
||||
# Edit, and rename this file to post-mozilla.pl to activate.
|
||||
# ./build-seamonkey-utils.pl will call PostMozilla::main() after
|
||||
# a successful build and testing of mozilla. This package can report
|
||||
# status via the $TinderUtils::build_status variable. Yeah this is a hack,
|
||||
# but it works for now. Feel free to improve this mechanism to properly
|
||||
# return values & stuff. -mcafee
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
package PostMozilla;
|
||||
|
||||
|
||||
sub main {
|
||||
# Get build directory from caller.
|
||||
my ($mozilla_build_dir) = @_;
|
||||
|
||||
|
||||
TinderUtils::print_log "Post-Mozilla build goes here.\n";
|
||||
|
||||
#
|
||||
# Build script goes here.
|
||||
#
|
||||
|
||||
# Report some kind of status to parent script.
|
||||
#
|
||||
# {'busted', 'testfailed', 'success'}
|
||||
#
|
||||
|
||||
# Report a fake success, for example's sake.
|
||||
# we return a list because sometimes we pass back a status *and*
|
||||
# a url to a binary location, e.g.:
|
||||
# return ('success', 'http://upload.host.org/path/to/binary');
|
||||
# tinderbox processes the binary url and links to it in the log.
|
||||
return ('success');
|
||||
}
|
||||
|
||||
# Need to end with a true value, (since we're using "require").
|
||||
1;
|
||||
362
mozilla/tools/tinderbox/qatest.pl
Executable file
@@ -0,0 +1,362 @@
|
||||
#!/usr/bin/perl -w
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
#
|
||||
###################################################################
|
||||
# Report Summary Generator for ARMS v2.0 by Vladimir Ermakov
|
||||
###################################################################
|
||||
# This file parses through a results file and generates a
|
||||
# test summary giving the following info:
|
||||
# # of tcs passed
|
||||
# # of tcs failed
|
||||
# # of tcs died
|
||||
# % of pass and fail
|
||||
# List of testcases that failed.
|
||||
# Separates the results into suites with a convinient quick link
|
||||
# at the top of the page
|
||||
###################################################################
|
||||
# Questions Coments go to vladimire@netscape.com
|
||||
###################################################################
|
||||
|
||||
sub PrintUsage {
|
||||
die <<END_USAGE
|
||||
usage: $0 <filename> ["express"]
|
||||
END_USAGE
|
||||
}
|
||||
|
||||
if ($#ARGV < 0) {
|
||||
PrintUsage();
|
||||
}
|
||||
|
||||
my $DATAFILE = $ARGV[0];
|
||||
my $MODE;
|
||||
|
||||
if($#ARGV > 0) {
|
||||
$MODE = $ARGV[1];
|
||||
} else {
|
||||
$MODE = "";
|
||||
}
|
||||
|
||||
my $express = 0;
|
||||
|
||||
if($MODE eq "express") {
|
||||
$express = 1;
|
||||
}
|
||||
|
||||
my $ngdir = "http://geckoqa.mcom.com/ngdriver/"; #$input->url(-base=>1) . "/ngdriver/";
|
||||
my $ngsuites = $ngdir . "suites/";
|
||||
my $conffile = "ngdriver.conf";
|
||||
my $HTMLreport = "";
|
||||
|
||||
unless ($express) {
|
||||
print "Content-type: text/html\n\n";
|
||||
}
|
||||
|
||||
&generateResults;
|
||||
|
||||
$File{'SuiteList'} = \@suiteArray;
|
||||
|
||||
&generateHTML;
|
||||
|
||||
$File{'Project'} = "Buffy";
|
||||
|
||||
print $HTMLreport;
|
||||
|
||||
sub generateResults
|
||||
{
|
||||
if (!open(INFILE,$DATAFILE)) {
|
||||
print "DATAFILE = $DATAFILE\n";
|
||||
print "<H3> Cannot open $?, $!</H3>\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
$File{'tcsPass'} = 0;
|
||||
$File{'tcsFail'} = 0;
|
||||
$File{'tcsDied'} = 0;
|
||||
$File{'tcsTotal'} = 0;
|
||||
|
||||
$line = <INFILE>;
|
||||
while ($line) {
|
||||
my %Suite = ();
|
||||
|
||||
my @diedArray = ();
|
||||
$Suite{'DiedList'} = \@diedArray;
|
||||
my @testArray = ();
|
||||
$Suite{'FailedList'} = \@testArray;
|
||||
|
||||
# Skip to first anchor.
|
||||
while (!($line =~ /<A NAME=".*?">/i) && $line) {
|
||||
$line = <INFILE>; # Go to next line.
|
||||
}
|
||||
|
||||
# First anchor.
|
||||
$line =~ /<A NAME="(.*?)"><H1>(.*?)<\/H1>/i;
|
||||
|
||||
|
||||
my $name = $1;
|
||||
my $title =$2;
|
||||
|
||||
$Suite{'Name'} = $name;
|
||||
$Suite{'Title'} = $title;
|
||||
|
||||
$Suite{'tcsPass'} = 0;
|
||||
$Suite{'tcsFail'} = 0;
|
||||
$Suite{'tcsDied'} = 0;
|
||||
$Suite{'tcsTotal'} = 0;
|
||||
|
||||
do
|
||||
{
|
||||
while ($line && !($line =~ /<TC>/i) && !($line =~ /<A name=".*?">/i)) {
|
||||
$line = <INFILE>;
|
||||
}
|
||||
|
||||
if ($line && ($line =~ /<A name=\"(.*?)\">/i) && ($1 eq $Suite{'Name'})) {
|
||||
$line = <INFILE>;
|
||||
}
|
||||
|
||||
# TC = test case.
|
||||
if ($line && ($line =~ /<TC>/i)) {
|
||||
while ($line && !($line =~ /<ENDTC>/i)) {
|
||||
$line1 = <INFILE>;
|
||||
if ($line1 =~ /<TC>/i) {
|
||||
print "<H1>SOMETHING WRONG!</H1><BR>"; next; next;
|
||||
}
|
||||
$line .= $line1;
|
||||
}
|
||||
|
||||
my ($tfName, $tcStat);
|
||||
my @lines = split /<->/, $line;
|
||||
$tfName = $lines[1];
|
||||
$tcStat = $lines[3];
|
||||
|
||||
# D=died, P=pass, F=failure
|
||||
if ($tcStat eq 'D') {
|
||||
$Suite{'tcsDied'} += 1;
|
||||
push(@diedArray,$line);
|
||||
}
|
||||
if ($tcStat eq 'P') {
|
||||
$Suite{'tcsPass'} += 1;
|
||||
$Suite{'tcsTotal'} += 1;
|
||||
}
|
||||
if ($tcStat eq 'F') {
|
||||
push(@testArray,$line);
|
||||
$Suite{'tcsFail'} += 1;
|
||||
$Suite{'tcsTotal'} += 1;
|
||||
}
|
||||
$line = <INFILE>;
|
||||
}
|
||||
} while ($line && !($line =~ /<A NAME=".*?">/i) && $line);
|
||||
|
||||
$File{'tcsPass'} += $Suite{'tcsPass'};
|
||||
$File{'tcsFail'} += $Suite{'tcsFail'};
|
||||
$File{'tcsTotal'} += $Suite{'tcsTotal'};
|
||||
$File{'tcsDied'} += $Suite{'tcsDied'};
|
||||
push(@suiteArray,\%Suite);
|
||||
}
|
||||
close INFILE;
|
||||
1;
|
||||
}
|
||||
|
||||
sub generateHTML
|
||||
{
|
||||
my $prjExtension;
|
||||
my %extList;
|
||||
|
||||
my $os = `uname -s`; # Cheap OS id for now
|
||||
|
||||
my %Matrices;
|
||||
|
||||
# Hard-coded from ngdriver.conf, I didn't want extra files in tree.
|
||||
|
||||
$extList{"mb"} = "http://cemicrobrowser.web.aol.com/bugReportDetail.php?RID=%";
|
||||
$extList{"bs"} = "http://bugscape.nscp.aoltw.net/show_bug.cgi?id=%";
|
||||
$extList{"bz"} = "http://bugzilla.mozilla.org/show_bug.cgi?id=%";
|
||||
$extList{"bzx"} = "http://bugzilla.mozilla.org/show_bug.cgi?id=%";
|
||||
|
||||
$prjExtension = "bz"; # Buffy hard-coded here.
|
||||
|
||||
$Matricies{"dom-core"} = "http://geckoqa.mcom.com/browser/standards/dom1/tcmatrix/index.html";
|
||||
$Matricies{"dom-html"} = "http://geckoqa.mcom.com/browser/standards/dom1/tcmatrix/index.html";
|
||||
$Matricies{"domevents"} = "http://geckoqa.mcom.com/browser/standards/dom1/tcmatrix/index.html";
|
||||
$Matricies{"javascript"} = "http://geckoqa.mcom.com/browser/standards/javascript/tcmatrix/index.html";
|
||||
$Matricies{"forms"} = "http://geckoqa.mcom.com/browser/standards/form_submission/tcmatrix/index.html";
|
||||
$Matricies{"formsec"} = "http://geckoqa.mcom.com/browser/standards/form_submission/tcmatrix/index.html";
|
||||
|
||||
unless ($express) {
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Test Result Summary on $File{'Platform'}</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center><u><font color="#990000"><h3>AUTOMATED TEST RESULTS</h3></font></u></center><br>
|
||||
<center>
|
||||
<table border="0" cols="3" width="90%">
|
||||
<tbody>
|
||||
<tr align="Left" valign="CENTER">
|
||||
<td width="250" valign="Middle"><b>OS: </b><font color="#990000">$os</script></font></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
<hr>
|
||||
<h3><u>The Following Test Suites Were Run:</u></h3>
|
||||
<UL>
|
||||
END_PRINT
|
||||
|
||||
for (my $var = 0;$File{'SuiteList'}->[$var]->{'Name'};$var++) {
|
||||
if (my $href = $Matrices{$File{'SuiteList'}->[$var]->{'Name'}}) {
|
||||
$HTMLreport .= "<li><a href=\"$href\">$File{'SuiteList'}->[$var]->{'Title'}</a></li>\n";
|
||||
} else {
|
||||
$HTMLreport .= "<li><a href=\"$ngsuites$File{'SuiteList'}->[$var]->{'Name'}\">$File{'SuiteList'}->[$var]->{'Title'}</a></li>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
</UL>
|
||||
|
||||
<h3><u>Test Result Summary:</u></h3>
|
||||
END_PRINT
|
||||
} # !express
|
||||
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<table border=2 cellspacing=0>
|
||||
<tr valign=top bgcolor=#CCCCCC>
|
||||
<td bgcolor=#999999> </td>
|
||||
<td>Passed</td>
|
||||
<td>Failed</td>
|
||||
<td>Total</td>
|
||||
<td>Died</td>
|
||||
<td>% Passed</td>
|
||||
<td>% Failed</td>
|
||||
</tr>
|
||||
END_PRINT
|
||||
|
||||
for (my $var = 0;$File{'SuiteList'}->[$var]->{'Name'};$var++) {
|
||||
$curSuite = $File{'SuiteList'}->[$var];
|
||||
|
||||
$HTMLreport .= "<tr valign=top>\n";
|
||||
if($express) {
|
||||
$HTMLreport .= "<td>$curSuite->{'Title'}</td>\n";
|
||||
} else {
|
||||
$HTMLreport .= "<td bgcolor=#cccccc><a href=\"#$curSuite->{'Name'}\">$curSuite->{'Title'}</a></td>\n";
|
||||
}
|
||||
$HTMLreport .= "<td>$File{'SuiteList'}->[$var]->{'tcsPass'}</td>\n";
|
||||
$HTMLreport .= "<td>$File{'SuiteList'}->[$var]->{'tcsFail'}</td>\n";
|
||||
$HTMLreport .= "<td>$File{'SuiteList'}->[$var]->{'tcsTotal'}</td>\n";
|
||||
$HTMLreport .= "<td>${@{$File{'SuiteList'}}[$var]}{'tcsDied'}</td>\n";
|
||||
|
||||
my $pctPass = $File{'SuiteList'}->[$var]->{'tcsPass'} / $File{'SuiteList'}->[$var]->{'tcsTotal'};
|
||||
$pctPass = int($pctPass*10000)/100;
|
||||
|
||||
$HTMLreport .= "<td>$pctPass</td>\n";
|
||||
|
||||
my $pctFail = $File{'SuiteList'}->[$var]->{'tcsFail'} / $File{'SuiteList'}->[$var]->{'tcsTotal'};
|
||||
$pctFail = int($pctFail*10000)/100;
|
||||
|
||||
$HTMLreport .= "<td>$pctFail</td>\n";
|
||||
$HTMLreport .= "</tr>\n";
|
||||
}
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<tr valign=top bgcolor=#FFFFCC>
|
||||
<td>Total:</td>
|
||||
<td>$File{'tcsPass'}</td>
|
||||
<td>$File{'tcsFail'}</td>
|
||||
<td>$File{'tcsTotal'}</td>
|
||||
<td>$File{'tcsDied'}</td>
|
||||
END_PRINT
|
||||
my $pctPass = $File{'tcsPass'} / $File{'tcsTotal'};
|
||||
$pctPass = int($pctPass*10000)/100;
|
||||
my $pctFail = $File{'tcsFail'} / $File{'tcsTotal'};
|
||||
$pctFail = int($pctFail*10000)/100;
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<td>$pctPass</td>
|
||||
<td>$pctFail</td>
|
||||
</tr>
|
||||
</table>
|
||||
END_PRINT
|
||||
|
||||
unless ($express) {
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<h3>Failed Testcases:</h3>
|
||||
END_PRINT
|
||||
|
||||
my $curSuite;
|
||||
for (my $var=0;$File{'SuiteList'}->[$var]->{'Name'};$var++) {
|
||||
$curSuite = $File{'SuiteList'}->[$var];
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
<hr>
|
||||
<h2>
|
||||
<a NAME="$curSuite->{'Name'}"></a><u><font color="#666600">$curSuite->{'Title'}</font></u></h2>
|
||||
<b><u>Died:</u></b>
|
||||
<table>
|
||||
END_PRINT
|
||||
|
||||
for (my $dcnt = 0;$curFile = $File{'SuiteList'}->[$var]->{'DiedList'}->[$dcnt];$dcnt++) {
|
||||
($none,$fName) = split(/<->/,$curFile);
|
||||
$HTMLreport .= "<tr><td style=\"color: red;\"><A href='$ngsuites$curSuite->{'Name'}/$fName' target=\"new\">$fName</A></td></tr>\n";
|
||||
}
|
||||
|
||||
$HTMLreport .= "</table><BR>\n";
|
||||
$HTMLreport .= "<b><u>Failures:</u></b><br>";
|
||||
$HTMLreport .= "<table BORDER CELLSPACING=0><TR>\n";
|
||||
|
||||
for ($fcnt = 0;$curFile = $File{'SuiteList'}->[$var]->{'FailedList'}->[$fcnt];$fcnt++) {
|
||||
($none,$fName,$fDesc,$fStat,$fBug,$fExpected,$fActual) = split(/<->/,$curFile);
|
||||
$HTMLreport.= "<TR><TD><A href=\"$ngsuites$curSuite->{'Name'}/$fName\" target=\"_new\">$fName</A></TD><TD>";
|
||||
|
||||
# Quiet perl warnings about unused variables.
|
||||
my $tmp; $tmp = $fStat; $tmp = $fActual; $tmp = $fExpected;
|
||||
|
||||
#
|
||||
# TEMPRORAY DISABLED.
|
||||
#
|
||||
my @bugList = split(/[\s+]|,/,$fBug);
|
||||
my $bug = "";
|
||||
my $index = 0;
|
||||
|
||||
while ($bugList[$index]) {
|
||||
if ($bugList[$index] =~ /(\d+)$prjExtension/i) {
|
||||
$bugList[$index] =~ s/(\d+)($prjExtension)/makelink($1,$extList{$2})/ige;
|
||||
$bug .= $bugList[$index];
|
||||
}
|
||||
|
||||
$index++;
|
||||
}
|
||||
$HTMLreport.= "$bug</TD><TD>$fDesc</TD></TR>\n";
|
||||
|
||||
# $fBug =~ s/(\d+)($prjExtension)/makelink($1,$extList{$2})/ige;
|
||||
# $HTMLreport.= "$fBug</TD><TD>$fDesc</TD></TR>\n";
|
||||
|
||||
}
|
||||
$HTMLreport .= "</table>\n";
|
||||
}
|
||||
|
||||
$HTMLreport .= <<END_PRINT;
|
||||
</BODY>
|
||||
</HTML>
|
||||
END_PRINT
|
||||
} # !express
|
||||
|
||||
1;
|
||||
}
|
||||
|
||||
sub makelink
|
||||
{
|
||||
$bugNum = $_[0];
|
||||
$bugLnk = $_[1];
|
||||
|
||||
|
||||
$bugLnk =~ s/%/$bugNum/ig;
|
||||
$bugLnk = "<A href=\"$bugLnk\">$bugNum</A>";
|
||||
|
||||
return $bugLnk;
|
||||
}
|
||||
|
||||
1;
|
||||
165
mozilla/tools/tinderbox/report-http-status.pl
Executable file
@@ -0,0 +1,165 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
#
|
||||
# Graph tree-open status, via tbox graph server.
|
||||
#
|
||||
|
||||
|
||||
# Location of this file. Make sure that hand-runs and crontab-runs
|
||||
# of this script read/write the same data.
|
||||
my $script_dir = "/builds/tinderbox/mozilla/tools/tinderbox";
|
||||
|
||||
my $graph_server = "coffee";
|
||||
|
||||
# Send data to graph server via HTTP.
|
||||
require "$script_dir/reportdata.pl";
|
||||
|
||||
use Sys::Hostname; # for ::hostname()
|
||||
|
||||
sub PrintUsage {
|
||||
die <<END_USAGE
|
||||
Usage:
|
||||
|
||||
$0 <ip or hostname>
|
||||
|
||||
END_USAGE
|
||||
}
|
||||
|
||||
|
||||
# Return true if httpd server is up.
|
||||
sub is_http_alive() {
|
||||
my $url = "http://$ARGV[0]";
|
||||
|
||||
my $rv = 0; # Assume false.
|
||||
|
||||
my $res =
|
||||
eval q{
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Request;
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->timeout(10); # seconds
|
||||
|
||||
my $req = HTTP::Request->new(GET => $url);
|
||||
my $res = $ua->request($req);
|
||||
return $res;
|
||||
};
|
||||
if ($@) {
|
||||
warn "GET Failed: $@";
|
||||
#print "GET Failed.\n";
|
||||
} else {
|
||||
# Debug.
|
||||
#print "GET Succeeded: \n";
|
||||
#print "status:\n", $res->status_line, "\n";
|
||||
#print "content:\n", $res->content, "\n";
|
||||
#print "GET Succeeded.\n";
|
||||
|
||||
# This will be non-zero if http get went through ok.
|
||||
if($res->content) {
|
||||
$rv = 1;
|
||||
} else {
|
||||
$rv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $rv;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# main
|
||||
{
|
||||
my $alive_time = 0; # Hours http has been up.
|
||||
my $alive = 0;
|
||||
my $timefile = "$script_dir/http_alive_timefiles/$ARGV[0]";
|
||||
|
||||
|
||||
# make sure directory exists
|
||||
unless (-d $timefile) {
|
||||
mkdir "$script_dir/http_alive_timefiles";
|
||||
}
|
||||
|
||||
PrintUsage() if $#ARGV == -1;
|
||||
|
||||
$alive = is_http_alive();
|
||||
|
||||
if ($alive) {
|
||||
print "$ARGV[0] is alive\n";
|
||||
|
||||
#
|
||||
# Record alive time.
|
||||
#
|
||||
|
||||
# Was zero before, report zero here, write out the
|
||||
# time for next cycle.
|
||||
if (not (-e "$timefile")) {
|
||||
print "no timefile found.\n";
|
||||
open TIMEFILE, ">$timefile";
|
||||
print TIMEFILE time();
|
||||
close TIMEFILE;
|
||||
} else {
|
||||
# Timefile found, compute difference and report that number.
|
||||
print "found timefile: $timefile!\n";
|
||||
|
||||
my $time_http_started = 0;
|
||||
my $now = 0;
|
||||
|
||||
open TIMEFILE, "$timefile";
|
||||
while (<TIMEFILE>) {
|
||||
chomp;
|
||||
$time_http_started = $_;
|
||||
}
|
||||
close TIMEFILE;
|
||||
print "time_http_started = $time_http_started\n";
|
||||
|
||||
$now = time();
|
||||
print "now = $now\n";
|
||||
|
||||
# Report time in hours.
|
||||
$alive_time = ($now - $time_http_started)/3600;
|
||||
print "alive_time (hours) = $alive_time\n";
|
||||
|
||||
# Clamp time to 20 hours so we don't get huge spikes for
|
||||
# extended open times (weekends)
|
||||
if ($alive_time > 20.0) {
|
||||
$alive_time = 20.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
print "$ARGV[0] is not responding.\n";
|
||||
|
||||
# Delete timefile if there is one.
|
||||
if (-e "$timefile") {
|
||||
unlink("$timefile");
|
||||
}
|
||||
}
|
||||
|
||||
# Shorten some machine names.
|
||||
my $short_name = "$ARGV[0]";
|
||||
$short_name =~ s/.websys.aol.com//g;
|
||||
|
||||
ReportData::send_results_to_server($graph_server,
|
||||
"$alive_time",
|
||||
::hostname(),
|
||||
"http_alive",
|
||||
"$ARGV[0]");
|
||||
|
||||
my $status = "";
|
||||
if($alive) {
|
||||
$status = "success";
|
||||
} else {
|
||||
$status = "busted";
|
||||
}
|
||||
|
||||
# Hard-coded for now.
|
||||
my $graph_url = "http://$graph_server/graph/query.cgi?tbox=$ARGV[0]&testname=http_alive&autoscale=&size=&days=7&units=hours<ype=&points=&avg=&showpoint=";
|
||||
|
||||
ReportData::send_tbox_packet("tinderbox-daemon\@warp.mcom.com",
|
||||
"Talkback",
|
||||
$status,
|
||||
"TinderboxPrint:<a title=\"Hours httpd:80 has been alive.\" href=\"$graph_url\">Ta</a>",
|
||||
"$ARGV[0]",
|
||||
"$short_name HTTP Alive Test");
|
||||
}
|
||||
160
mozilla/tools/tinderbox/report-tree-status.pl
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
#
|
||||
# Graph tree-open status, via tbox graph server.
|
||||
#
|
||||
|
||||
# Location of this file. Make sure that hand-runs and crontab-runs
|
||||
# of this script read/write the same data.
|
||||
my $script_dir = "/builds/tinderbox/mozilla/tools/tinderbox";
|
||||
|
||||
# Send data to graph server via HTTP.
|
||||
require "$script_dir/reportdata.pl";
|
||||
|
||||
use Sys::Hostname; # for ::hostname()
|
||||
|
||||
my $sheriff_string;
|
||||
|
||||
sub is_tree_open {
|
||||
my $tbox_url = "http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey";
|
||||
|
||||
# Dump tbox page source into a file.
|
||||
print "HTTP...";
|
||||
system ("wget", "-q", "-O", "$script_dir/tbox.source", $tbox_url);
|
||||
print "done\n";
|
||||
|
||||
my $rv = 0;
|
||||
|
||||
$sheriff_string = "";
|
||||
|
||||
# Scan file, looking for line that starts with <a NAME="open">
|
||||
open TBOX_FILE, "$script_dir/tbox.source";
|
||||
while (<TBOX_FILE>) {
|
||||
# Scan for open string
|
||||
if(/^<a NAME="open">/) {
|
||||
# look for "open" string
|
||||
if (/open<\/font>$/) {
|
||||
print "open\n";
|
||||
$rv = 1;
|
||||
} else {
|
||||
print "closed\n";
|
||||
$rv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
# Scan for sheriff string & save it off for HTTP submit later.
|
||||
if(/^<br><a NAME="sheriff"><\/a>/) {
|
||||
chomp;
|
||||
$sheriff_string = $_;
|
||||
|
||||
# Strip out content to save space.
|
||||
|
||||
# Strip out permanent content.
|
||||
$sheriff_string =~ s/^<br><a NAME="sheriff"><\/a>//;
|
||||
|
||||
# Crude attempt at reducing the random html that shows up here.
|
||||
# Order is important, pick off easy tags, then make it legal cgi,
|
||||
# then shorten it up.
|
||||
$sheriff_string =~ s/<[pP]>//g;
|
||||
$sheriff_string =~ s/\015//g; # ^M
|
||||
$sheriff_string =~ s/<br>//g;
|
||||
$sheriff_string =~ s/<\/a>//g;
|
||||
$sheriff_string =~ s/<//g;
|
||||
$sheriff_string =~ s/>//g;
|
||||
$sheriff_string =~ s/"/ /g;
|
||||
$sheriff_string =~ s/\///g;
|
||||
$sheriff_string =~ s/\\//g;
|
||||
$sheriff_string =~ s/#/[lb]/g;
|
||||
$sheriff_string =~ s/mailto://g;
|
||||
$sheriff_string =~ s/[aA][iI][mM]://g;
|
||||
$sheriff_string =~ s/[iI][rR][cC]://g;
|
||||
$sheriff_string =~ s/a href//g;
|
||||
$sheriff_string =~ s/[sS]heriff//g;
|
||||
$sheriff_string =~ s/[mM]onday//g;
|
||||
$sheriff_string =~ s/[tT]uesday//g;
|
||||
$sheriff_string =~ s/[wW]ednesday//g;
|
||||
$sheriff_string =~ s/[tT]hursday//g;
|
||||
$sheriff_string =~ s/[fF]riday//g;
|
||||
$sheriff_string =~ s/[wW]eekend//g;
|
||||
$sheriff_string =~ s/^[tT]he //g;
|
||||
$sheriff_string =~ s/\/a//g;
|
||||
$sheriff_string =~ s/netscape.com/nscp/g;
|
||||
$sheriff_string =~ s/mozilla.org/moz/g;
|
||||
$sheriff_string =~ s/ is / /g;
|
||||
$sheriff_string =~ s/ for / /g;
|
||||
$sheriff_string =~ s/ on / /g;
|
||||
$sheriff_string =~ s/ in / /g;
|
||||
$sheriff_string =~ s/ = / /g;
|
||||
$sheriff_string =~ s/ - / /g;
|
||||
|
||||
$sheriff_string = substr($sheriff_string,0,60);
|
||||
print "sheriff string = $sheriff_string\n";
|
||||
}
|
||||
}
|
||||
close TBOX_FILE;
|
||||
|
||||
# Clean up.
|
||||
unlink("$script_dir/tbox.source");
|
||||
|
||||
return $rv;
|
||||
}
|
||||
|
||||
|
||||
# main
|
||||
{
|
||||
my $time_since_open = 0;
|
||||
my $timefile = "$script_dir/treeopen_timefile";
|
||||
|
||||
# Get tree status.
|
||||
if(is_tree_open()) {
|
||||
|
||||
# Record tree open time if not set.
|
||||
if (not (-e "$timefile")) {
|
||||
open TIMEFILE, ">$timefile";
|
||||
print TIMEFILE time();
|
||||
close TIMEFILE;
|
||||
} else {
|
||||
# Timefile found, compute difference and report that number.
|
||||
print "found timefile: $timefile!\n";
|
||||
|
||||
my $time_tree_opened = 0;
|
||||
my $now = 0;
|
||||
|
||||
open TIMEFILE, "$timefile";
|
||||
while (<TIMEFILE>) {
|
||||
chomp;
|
||||
$time_tree_opened = $_;
|
||||
}
|
||||
close TIMEFILE;
|
||||
print "time_tree_opened = $time_tree_opened\n";
|
||||
|
||||
$now = time();
|
||||
print "now = $now\n";
|
||||
|
||||
# Report time in hours.
|
||||
$time_since_open = ($now - $time_tree_opened)/3600;
|
||||
print "time_since_open (hours) = $time_since_open\n";
|
||||
|
||||
# Clamp time to 20 hours so we don't get huge spikes for
|
||||
# extended open times (weekends)
|
||||
if($time_since_open > 20.0) {
|
||||
$time_since_open = 20.0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
# tree is closed, leave tree_open_time at zero.
|
||||
|
||||
# Delete timefile if there is one.
|
||||
if (-e "$timefile") {
|
||||
unlink("$timefile");
|
||||
}
|
||||
}
|
||||
|
||||
ReportData::send_results_to_server("tegu.mozilla.org",
|
||||
"$time_since_open",
|
||||
"$sheriff_string",
|
||||
"treeopen", ::hostname());
|
||||
}
|
||||
84
mozilla/tools/tinderbox/reportdata.pl
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
||||
|
||||
|
||||
#
|
||||
# Utils used by tests to send data to graph server, or tinderbox.
|
||||
#
|
||||
|
||||
require 5.003;
|
||||
|
||||
use strict;
|
||||
|
||||
$::Version = '$Revision: 1.3 $ ';
|
||||
|
||||
package ReportData;
|
||||
|
||||
# Send data to graph cgi via HTTP.
|
||||
sub send_results_to_server {
|
||||
my ($server, $value, $data, $testname, $tbox) = @_;
|
||||
|
||||
my $tmpurl = "http://$server/graph/collect.cgi";
|
||||
$tmpurl .= "?value=$value&data=$data&testname=$testname&tbox=$tbox";
|
||||
|
||||
print "send_results_to_server(): \n";
|
||||
print "tmpurl = $tmpurl\n";
|
||||
|
||||
# libwww-perl has process control problems on windows,
|
||||
# spawn wget instead.
|
||||
if ($Settings::OS =~ /^WIN/) {
|
||||
system ("wget", "-o", "/dev/null", $tmpurl);
|
||||
print "send_results_to_server() succeeded.\n";
|
||||
} else {
|
||||
my $res = eval q{
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Request;
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->timeout(10); # seconds
|
||||
my $req = HTTP::Request->new(GET => $tmpurl);
|
||||
my $res = $ua->request($req);
|
||||
return $res;
|
||||
};
|
||||
if ($@) {
|
||||
warn "Failed to submit startup results: $@";
|
||||
print "send_results_to_server() failed.\n";
|
||||
} else {
|
||||
print "Results submitted to server: \n",
|
||||
$res->status_line, "\n", $res->content, "\n";
|
||||
print "send_results_to_server() succeeded.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Fake a tinderbox message.
|
||||
sub send_tbox_packet {
|
||||
my ($server_email, $tree, $status,
|
||||
$log, $machine, $build_name) = @_;
|
||||
|
||||
my $foo;
|
||||
|
||||
my $now = time();
|
||||
|
||||
$foo .= <<END_PRINT;
|
||||
tinderbox: tree: $tree
|
||||
tinderbox: builddate: $now
|
||||
tinderbox: status: $status
|
||||
tinderbox: build: $build_name
|
||||
tinderbox: errorparser: unix
|
||||
tinderbox: buildfamily: unix
|
||||
tinderbox: END
|
||||
END_PRINT
|
||||
|
||||
$foo .= $log;
|
||||
|
||||
print "foo = \n$foo\n";
|
||||
|
||||
open MSG, ">msg.$machine";
|
||||
print MSG $foo;
|
||||
close MSG;
|
||||
|
||||
system "/bin/mail $server_email " . "< msg.$machine";
|
||||
|
||||
|
||||
unlink "msg.$machine";
|
||||
}
|
||||
170
mozilla/tools/tinderbox/tinder-defaults.pl
Normal file
@@ -0,0 +1,170 @@
|
||||
#- PLEASE FILL THIS IN WITH YOUR PROPER EMAIL ADDRESS
|
||||
#$BuildAdministrator = "$ENV{USER}\@$ENV{HOST}";
|
||||
$BuildAdministrator = ($ENV{USER} || "cltbld") . "\@" . ($ENV{HOST} || "dhcp");
|
||||
|
||||
#- You'll need to change these to suit your machine's needs
|
||||
$DisplayServer = ':0.0';
|
||||
|
||||
#- Default values of command-line opts
|
||||
#-
|
||||
$BuildDepend = 1; # Depend or Clobber
|
||||
$BuildDebug = 0; # Debug or Opt (Darwin)
|
||||
$ReportStatus = 1; # Send results to server, or not
|
||||
$ReportFinalStatus = 1; # Finer control over $ReportStatus.
|
||||
$UseTimeStamp = 1; # Use the CVS 'pull-by-timestamp' option, or not
|
||||
$BuildOnce = 0; # Build once, don't send results to server
|
||||
$TestOnly = 0; # Only run tests, don't pull/build
|
||||
$BuildEmbed = 0; # After building seamonkey, go build embed app.
|
||||
$SkipMozilla = 0; # Use to debug post-mozilla.pl scripts.
|
||||
|
||||
# Tests
|
||||
$CleanProfile = 0;
|
||||
$ResetHomeDirForTests = 1;
|
||||
$ProductName = "Mozilla";
|
||||
|
||||
$RunMozillaTests = 1; # Allow turning off of all tests if needed.
|
||||
$RegxpcomTest = 1;
|
||||
$AliveTest = 1;
|
||||
$JavaTest = 0;
|
||||
$ViewerTest = 0;
|
||||
$BloatTest = 0; # warren memory bloat test
|
||||
$BloatTest2 = 0; # dbaron memory bloat test, require tracemalloc
|
||||
$DomToTextConversionTest = 0;
|
||||
$XpcomGlueTest = 0;
|
||||
$CodesizeTest = 0; # Z, require mozilla/tools/codesighs
|
||||
$EmbedCodesizeTest = 0; # mZ, require mozilla/tools/codesigns
|
||||
$MailBloatTest = 0;
|
||||
$EmbedTest = 0; # Assumes you wanted $BuildEmbed=1
|
||||
$LayoutPerformanceTest = 0; # Tp
|
||||
$QATest = 0;
|
||||
$XULWindowOpenTest = 0; # Txul
|
||||
$StartupPerformanceTest = 0; # Ts
|
||||
|
||||
# Release Build options
|
||||
# requires an appropriate post-mozilla.pl
|
||||
$ReleaseBuild = 0; # Make a release build?
|
||||
$package_creation_path = "mozilla/xpinstall/packager";
|
||||
$package_location = "mozilla/dist/install";
|
||||
$ftp_path = "/home/ftp/pub/mozilla/tinderbox-builds";
|
||||
$url_path = "http://ftp.mozilla.org/pub/mozilla.org/mozilla/tinderbox-builds";
|
||||
$build_hour = "8";
|
||||
$ssh_server = "stage.mozilla.org";
|
||||
$ssh_user = "cltbld";
|
||||
|
||||
# end Release Build options
|
||||
|
||||
$TestsPhoneHome = 0; # Should test report back to server?
|
||||
$results_server = "axolotl.mozilla.org"; # was tegu
|
||||
$pageload_server = "spider"; # localhost
|
||||
|
||||
#
|
||||
# Timeouts, values are in seconds.
|
||||
#
|
||||
|
||||
$CreateProfileTimeout = 45;
|
||||
$RegxpcomTestTimeout = 15;
|
||||
|
||||
$AliveTestTimeout = 45;
|
||||
$ViewerTestTimeout = 45;
|
||||
$EmbedTestTimeout = 45;
|
||||
$BloatTestTimeout = 120; # seconds
|
||||
$MailBloatTestTimeout = 120; # seconds
|
||||
$JavaTestTimeout = 45;
|
||||
$DomTestTimeout = 45; # seconds
|
||||
$XpcomGlueTestTimeout = 15;
|
||||
$CodesizeTestTimeout = 900; # seconds
|
||||
$CodesizeTestType = "auto"; # {"auto"|"base"}
|
||||
$LayoutPerformanceTestTimeout = 1200; # entire test, seconds
|
||||
$QATestTimeout = 1200; # entire test, seconds
|
||||
$LayoutPerformanceTestPageTimeout = 30000; # each page, ms
|
||||
$StartupPerformanceTestTimeout = 60; # seconds
|
||||
$XULWindowOpenTestTimeout = 150; # seconds
|
||||
|
||||
|
||||
$MozConfigFileName = 'mozconfig';
|
||||
|
||||
$UseMozillaProfile = 1;
|
||||
$MozProfileName = 'default';
|
||||
|
||||
#- Set these to what makes sense for your system
|
||||
$Make = 'gmake'; # Must be GNU make
|
||||
$MakeOverrides = '';
|
||||
$mail = '/bin/mail';
|
||||
$CVS = 'cvs -q';
|
||||
$CVSCO = 'checkout -P';
|
||||
|
||||
# win32 usually doesn't have /bin/mail
|
||||
$blat = 'c:/nstools/bin/blat';
|
||||
$use_blat = 0;
|
||||
|
||||
# Set moz_cvsroot to something like:
|
||||
# :pserver:$ENV{USER}%netscape.com\@cvs.mozilla.org:/cvsroot
|
||||
# :pserver:anonymous\@cvs-mirror.mozilla.org:/cvsroot
|
||||
#
|
||||
# Note that win32 may not need \@, depends on ' or ".
|
||||
# :pserver:$ENV{USER}%netscape.com@cvs.mozilla.org:/cvsroot
|
||||
|
||||
$moz_cvsroot = $ENV{CVSROOT};
|
||||
|
||||
#- Set these proper values for your tinderbox server
|
||||
$Tinderbox_server = 'tinderbox-daemon@tinderbox.mozilla.org';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
$moz_client_mk = 'client.mk';
|
||||
|
||||
# Allow for non-client builds, e.g. camino.
|
||||
$moz_client_mk = 'client.mk';
|
||||
|
||||
#- Set if you want to build in a separate object tree
|
||||
$ObjDir = '';
|
||||
|
||||
# Extra build name, if needed.
|
||||
$BuildNameExtra = '';
|
||||
|
||||
# User comment, eg. ip address for dhcp builds.
|
||||
# ex: $UserComment = "ip = 208.12.36.108";
|
||||
$UserComment = 0;
|
||||
|
||||
#-
|
||||
#- The rest should not need to be changed
|
||||
#-
|
||||
|
||||
#- Minimum wait period from start of build to start of next build in minutes.
|
||||
$BuildSleep = 10;
|
||||
|
||||
#- Until you get the script working. When it works,
|
||||
#- change to the tree you're actually building
|
||||
$BuildTree = 'MozillaTest';
|
||||
|
||||
$BuildName = '';
|
||||
$BuildTag = '';
|
||||
$BuildConfigDir = 'mozilla/config';
|
||||
$Topsrcdir = 'mozilla';
|
||||
|
||||
$BinaryName = 'mozilla-bin';
|
||||
|
||||
#
|
||||
# For embedding app, use:
|
||||
$EmbedBinaryName = 'TestGtkEmbed';
|
||||
$EmbedDistDir = 'dist/bin'
|
||||
|
||||
|
||||
$ShellOverride = ''; # Only used if the default shell is too stupid
|
||||
$ConfigureArgs = '';
|
||||
$ConfigureEnvArgs = '';
|
||||
$Compiler = 'gcc';
|
||||
$NSPRArgs = '';
|
||||
$ShellOverride = '';
|
||||
|
||||
# allow override of timezone value (for win32 POSIX::strftime)
|
||||
$Timezone = '';
|
||||
|
||||
# Reboot the OS at the end of build-and-test cycle. This is primarily
|
||||
# intended for Win9x, which can't last more than a few cycles before
|
||||
# locking up (and testing would be suspect even after a couple of cycles).
|
||||
# Right now, there is only code to force the reboot for Win9x, so even
|
||||
# setting this to 1, will not have an effect on other platforms. Setting
|
||||
# up win9x to automatically logon and begin running tinderbox is left
|
||||
# as an exercise to the reader.
|
||||
$RebootSystem = 0;
|
||||
|
||||
118
mozilla/tools/tinderbox/tinderbox
Executable file
@@ -0,0 +1,118 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is Mozilla Communicator.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Chris McAfee.
|
||||
# Portions created by Chris McAfee are
|
||||
# Copyright (C) The Mozilla Organization.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Chris McAfee <mcafee@netscape.com>
|
||||
#
|
||||
|
||||
#
|
||||
# Tinderbox control script.
|
||||
#
|
||||
# Assumes that at most two tinderboxes are running
|
||||
# simultaneously, depend and clobber.
|
||||
#
|
||||
# Assumes that if mozconfig exists, use it. Format:
|
||||
# mk_add_options MOZ_MAKE_FLAGS=j8
|
||||
# ac_add_options --disable-debug
|
||||
# ac_add_options --enable-optimize
|
||||
#
|
||||
|
||||
|
||||
tinderbox_usage() {
|
||||
echo "Usage: tinderbox [depend|clobber|multi] {start|stop|status|restart}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 2 ]; then
|
||||
echo "Wrong number of arguments."
|
||||
tinderbox_usage
|
||||
fi
|
||||
|
||||
build_type="$1"
|
||||
build_action="$2"
|
||||
|
||||
# Depend or clobber build?
|
||||
if [ "$build_type" != "depend" -a \
|
||||
"$build_type" != "clobber" -a \
|
||||
"$build_type" != "multi" ]; then
|
||||
echo "Unknown option: $1"
|
||||
tinderbox_usage
|
||||
fi
|
||||
|
||||
# See how we were called.
|
||||
case "$build_action" in
|
||||
start)
|
||||
if test -f $build_type.pid; then
|
||||
echo "$build_type build already running with PID "`cat $build_type.pid`
|
||||
else
|
||||
echo "Starting $build_type tinderbox..."
|
||||
|
||||
# Say if we found post-mozilla.pl
|
||||
if test -f post-mozilla.pl; then
|
||||
echo "Found post-mozilla.pl"
|
||||
fi
|
||||
|
||||
# Grab and use mozconfig if it exists.
|
||||
if test "$build_type" = "multi"; then
|
||||
nohup ./multi-tinderbox.pl &
|
||||
elif test -f mozconfig; then
|
||||
echo "Found mozconfig..."
|
||||
nohup ./build-seamonkey.pl --$build_type --mozconfig mozconfig &
|
||||
elif test -f .mozconfig; then
|
||||
echo "Found .mozconfig..."
|
||||
nohup ./build-seamonkey.pl --$build_type --mozconfig .mozconfig &
|
||||
else
|
||||
nohup ./build-seamonkey.pl --$build_type &
|
||||
fi
|
||||
# Write out PID so we can shut things down later.
|
||||
# This needs to be right after the ./build-seamonkey.pl call to
|
||||
# get the right PID.
|
||||
echo "PID $!"
|
||||
echo $! > $build_type.pid
|
||||
\rm -f nohup.out
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
if test -f $build_type.pid; then
|
||||
pid=`cat $build_type.pid`
|
||||
echo "Shutting down $build_type tinderbox, PID = $pid"
|
||||
kill $pid
|
||||
\rm $build_type.pid
|
||||
else
|
||||
echo "$build_type is not running."
|
||||
fi
|
||||
echo
|
||||
;;
|
||||
status)
|
||||
if test -f $build_type.pid; then
|
||||
echo "$build_type build is running with PID of "`cat $build_type.pid`
|
||||
else
|
||||
echo "$build_type build is not running."
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
echo "Restarting $build_type tinderbox:"
|
||||
$0 $build_type stop
|
||||
$0 $build_type start
|
||||
;;
|
||||
*)
|
||||
tinderbox_usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -1,5 +0,0 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
RewriteRule ^$ webroot/ [L]
|
||||
RewriteRule (.*) webroot/$1 [L]
|
||||
</IfModule>
|
||||
@@ -1,25 +0,0 @@
|
||||
SERVER REQUIREMENTS
|
||||
- Apache 1.3 or higher with mod_rewrite enabled
|
||||
- PHP 4.3.2 or higher
|
||||
- CakePHP 1.1.7.3363 or higher
|
||||
- MySQL (preferred) or PostgreSQL
|
||||
|
||||
INSTALLATION:
|
||||
- All files accompanying this README should be placed into the /app directory of
|
||||
your CakePHP install. Once complete, you should have a directory structure similar
|
||||
to the following where (/) is the base of your domain:
|
||||
/
|
||||
app/
|
||||
config/
|
||||
controllers/
|
||||
models/
|
||||
webroot/
|
||||
...
|
||||
cake/
|
||||
vendors/
|
||||
|
||||
- Import the database schema (/app/config/dist.sql) into your database
|
||||
- Rename database.dist.php to database.php and edit the file to reflect your
|
||||
database configuration
|
||||
- Rename bootstrap.dist.php to bootstrap.php and follow the editing instructions
|
||||
within. All fields except APP_* and MAX_YEAR are optional.
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
class AppController extends Controller {
|
||||
}
|
||||
?>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
class AppModel extends Model {
|
||||
}
|
||||
?>
|
||||
@@ -1,76 +0,0 @@
|
||||
;<?php die() ?>
|
||||
; SVN FILE: $Id: acl.ini.php,v 1.3 2006-10-08 03:39:21 reed%reedloden.com Exp $
|
||||
;/**
|
||||
; * Short 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.config
|
||||
; * @since CakePHP v 0.10.0.1076
|
||||
; * @version $Revision: 1.3 $
|
||||
; * @modifiedby $LastChangedBy: phpnut $
|
||||
; * @lastmodified $Date: 2006-10-08 03:39:21 $
|
||||
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
; */
|
||||
|
||||
; acl.ini.php - Cake ACL Configuration
|
||||
; ---------------------------------------------------------------------
|
||||
; Use this file to specify user permissions.
|
||||
; aco = access control object (something in your application)
|
||||
; aro = access request object (something requesting access)
|
||||
;
|
||||
; User records are added as follows:
|
||||
;
|
||||
; [uid]
|
||||
; groups = group1, group2, group3
|
||||
; allow = aco1, aco2, aco3
|
||||
; deny = aco4, aco5, aco6
|
||||
;
|
||||
; Group records are added in a similar manner:
|
||||
;
|
||||
; [gid]
|
||||
; allow = aco1, aco2, aco3
|
||||
; deny = aco4, aco5, aco6
|
||||
;
|
||||
; The allow, deny, and groups sections are all optional.
|
||||
; NOTE: groups names *cannot* ever be the same as usernames!
|
||||
;
|
||||
; ACL permissions are checked in the following order:
|
||||
; 1. Check for user denies (and DENY if specified)
|
||||
; 2. Check for user allows (and ALLOW if specified)
|
||||
; 3. Gather user's groups
|
||||
; 4. Check group denies (and DENY if specified)
|
||||
; 5. Check group allows (and ALLOW if specified)
|
||||
; 6. If no aro, aco, or group information is found, DENY
|
||||
;
|
||||
; ---------------------------------------------------------------------
|
||||
|
||||
;-------------------------------------
|
||||
;Users
|
||||
;-------------------------------------
|
||||
|
||||
[username-goes-here]
|
||||
groups = group1, group2
|
||||
deny = aco1, aco2
|
||||
allow = aco3, aco4
|
||||
|
||||
;-------------------------------------
|
||||
;Groups
|
||||
;-------------------------------------
|
||||
|
||||
[groupname-goes-here]
|
||||
deny = aco5, aco6
|
||||
allow = aco7, aco8
|
||||
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
/* REQUIRED - APP_NAME is used on all <title>s and mail names/subjects. APP_BASE
|
||||
* should be a FQDN with protocol minus the trailing slash e.g. http://example.tld/party
|
||||
*/
|
||||
define('APP_NAME', '');
|
||||
define('APP_EMAIL', '');
|
||||
define('APP_BASE', '');
|
||||
|
||||
/* 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://code.google.com/apis/soapsearch/
|
||||
*/
|
||||
define('GSEARCH_API_KEY', '');
|
||||
|
||||
/* The maximum year shown for party registrations */
|
||||
define('MAX_YEAR', 2007);
|
||||
|
||||
/* 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,147 +0,0 @@
|
||||
<?php
|
||||
/* SVN FILE: $Id: core.php,v 1.4 2006-10-08 03:39:21 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* This is core configuration file.
|
||||
*
|
||||
* Use it to configure core behaviour ofCake.
|
||||
*
|
||||
* 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.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.4 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-10-08 03:39:21 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* If you do not have mod rewrite on your system
|
||||
* or if you prefer to use CakePHP pretty urls.
|
||||
* uncomment the line below.
|
||||
* Note: If you do have mod rewrite but prefer the
|
||||
* CakePHP pretty urls, you also have to remove the
|
||||
* .htaccess files
|
||||
* release/.htaccess
|
||||
* release/app/.htaccess
|
||||
* release/app/webroot/.htaccess
|
||||
*/
|
||||
// define ('BASE_URL', env('SCRIPT_NAME'));
|
||||
/**
|
||||
* Set debug level here:
|
||||
* - 0: production
|
||||
* - 1: development
|
||||
* - 2: full debug with sql
|
||||
* - 3: full debug with sql and dump of the current object
|
||||
*
|
||||
* In production, the "flash messages" redirect after a time interval.
|
||||
* With the other debug levels you get to click the "flash message" to continue.
|
||||
*
|
||||
*/
|
||||
define('DEBUG', 0);
|
||||
/**
|
||||
* Turn of caching checking wide.
|
||||
* You must still use the controller var cacheAction inside you controller class.
|
||||
* You can either set it controller wide, or in each controller method.
|
||||
* use var $cacheAction = true; or in the controller method $this->cacheAction = true;
|
||||
*/
|
||||
define('CACHE_CHECK', false);
|
||||
/**
|
||||
* Error constant. Used for differentiating error logging and debugging.
|
||||
* Currently PHP supports LOG_DEBUG
|
||||
*/
|
||||
define('LOG_ERROR', 2);
|
||||
/**
|
||||
* CakePHP includes 3 types of session saves
|
||||
* database or file. Set this to your preferred method.
|
||||
* If you want to use your own save handler place it in
|
||||
* app/config/name.php DO NOT USE file or database as the name.
|
||||
* and use just the name portion below.
|
||||
*
|
||||
* Setting this to cake will save files to /cakedistro/tmp directory
|
||||
* Setting it to php will use the php default save path
|
||||
* Setting it to database will use the database
|
||||
*
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_SAVE', 'database');
|
||||
/**
|
||||
* If using you own table name for storing sessions
|
||||
* set the table name here.
|
||||
* DO NOT INCLUDE PREFIX IF YOU HAVE SET ONE IN database.php
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_TABLE', 'sessions');
|
||||
/**
|
||||
* Set a random string of used in session.
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_STRING', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');
|
||||
/**
|
||||
* Set the name of session cookie
|
||||
*
|
||||
*/
|
||||
define('CAKE_SESSION_COOKIE', 'sess');
|
||||
/**
|
||||
* Set level of Cake security.
|
||||
*
|
||||
*/
|
||||
define('CAKE_SECURITY', 'high');
|
||||
/**
|
||||
* Set Cake Session time out.
|
||||
* If CAKE_SECURITY define is set
|
||||
* high: multiplied by 10
|
||||
* medium: is multiplied by 100
|
||||
* low is: multiplied by 300
|
||||
*
|
||||
* Number below is seconds.
|
||||
*/
|
||||
define('CAKE_SESSION_TIMEOUT', '120');
|
||||
/**
|
||||
* Uncomment the define below to use cake built in admin routes.
|
||||
* You can set this value to anything you want.
|
||||
* All methods related to the admin route should be prefixed with the
|
||||
* name you set CAKE_ADMIN to.
|
||||
* For example: admin_index, admin_edit
|
||||
*/
|
||||
// define('CAKE_ADMIN', 'admin');
|
||||
/**
|
||||
* The define below is used to turn cake built webservices
|
||||
* on or off. Default setting is off.
|
||||
*/
|
||||
define('WEBSERVICES', 'off');
|
||||
/**
|
||||
* Compress output CSS (removing comments, whitespace, repeating tags etc.)
|
||||
* This requires a/var/cache directory to be writable by the web server (caching).
|
||||
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use Controller::cssTag().
|
||||
*/
|
||||
define('COMPRESS_CSS', false);
|
||||
/**
|
||||
* If set to true, helpers would output data instead of returning it.
|
||||
*/
|
||||
define('AUTO_OUTPUT', false);
|
||||
/**
|
||||
* If set to false, session would not automatically be started.
|
||||
*/
|
||||
define('AUTO_SESSION', true);
|
||||
/**
|
||||
* Set the max size of file to use md5() .
|
||||
*/
|
||||
define('MAX_MD5SIZE', (5 * 1024) * 1024);
|
||||
/**
|
||||
* To use Access Control Lists with Cake...
|
||||
*/
|
||||
define('ACL_CLASSNAME', 'DB_ACL');
|
||||
define('ACL_FILENAME', 'dbacl' . DS . 'db_acl');
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
class DATABASE_CONFIG {
|
||||
var $default = array('driver' => 'mysql',
|
||||
'connect' => 'mysql_connect',
|
||||
'host' => 'localhost',
|
||||
'login' => '',
|
||||
'password' => '',
|
||||
'database' => '');
|
||||
}
|
||||
?>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/* SVN FILE: $Id: inflections.php,v 1.3 2006-10-08 03:39:21 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Custom Inflected Words.
|
||||
*
|
||||
* This file is used to hold words that are not matched in the normail Inflector::pluralize() and
|
||||
* Inflector::singularize()
|
||||
*
|
||||
* PHP versions 4 and %
|
||||
*
|
||||
* 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.config
|
||||
* @since CakePHP v 1.0.0.2312
|
||||
* @version $Revision: 1.3 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-10-08 03:39:21 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* This is a key => value array of regex used to match words.
|
||||
* If key matches then the value is returned.
|
||||
*
|
||||
* $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice');
|
||||
*/
|
||||
$pluralRules = array();
|
||||
/**
|
||||
* This is a key only array of plural words that should not be inflected.
|
||||
* Notice the last comma
|
||||
*
|
||||
* $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox');
|
||||
*/
|
||||
$uninflectedPlural = array();
|
||||
/**
|
||||
* This is a key => value array of plural irregular words.
|
||||
* If key matches then the value is returned.
|
||||
*
|
||||
* $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers')
|
||||
*/
|
||||
$irregularPlural = array();
|
||||
/**
|
||||
* This is a key => value array of regex used to match words.
|
||||
* If key matches then the value is returned.
|
||||
*
|
||||
* $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i')
|
||||
*/
|
||||
$singularRules = array();
|
||||
/**
|
||||
* This is a key only array of singular words that should not be inflected.
|
||||
* You should not have to change this value below if you do change it use same format
|
||||
* as the $uninflectedPlural above.
|
||||
*/
|
||||
$uninflectedSingular = $uninflectedPlural;
|
||||
/**
|
||||
* This is a key => value array of singular irregular words.
|
||||
* Most of the time this will be a reverse of the above $irregularPlural array
|
||||
* You should not have to change this value below if you do change it use same format
|
||||
*
|
||||
* $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother')
|
||||
*/
|
||||
$irregularSingular = array_flip($irregularPlural);
|
||||
?>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
/* SVN FILE: $Id: routes.php,v 1.5 2006-10-10 20:18:59 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* Short description for file.
|
||||
*
|
||||
* In this file, you set up routes to your controllers and their actions.
|
||||
* Routes are very important mechanism that allows you to freely connect
|
||||
* different urls to chosen controllers and their actions (functions).
|
||||
*
|
||||
* 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.config
|
||||
* @since CakePHP v 0.2.9
|
||||
* @version $Revision: 1.5 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-10-10 20:18:59 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
/**
|
||||
* Here, we are connecting '/' (base path) to controller called 'Pages',
|
||||
* its action called 'display', and we pass a param to select the view file
|
||||
* to use (in this case, /app/views/pages/home.thtml)...
|
||||
*/
|
||||
$Route->connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
|
||||
/**
|
||||
* ...and connect the rest of 'Pages' controller's urls.
|
||||
*/
|
||||
$Route->connect('/pages/edit', array('controller' => 'pages', 'action' => 'edit'));
|
||||
$Route->connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
|
||||
$Route->connect('/privacy-policy', array('controller' => 'pages', 'action' => 'privacy'));
|
||||
?>
|
||||
@@ -1,80 +0,0 @@
|
||||
CREATE TABLE `comments` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`assoc` int(10) NOT NULL default '0',
|
||||
`owner` int(10) NOT NULL default '0',
|
||||
`time` int(15) NOT NULL default '0',
|
||||
`text` text collate utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE `guests` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`pid` int(10) NOT NULL default '0',
|
||||
`uid` int(10) NOT NULL default '0',
|
||||
`invited` tinyint(1) NOT NULL default '1',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `pid` (`pid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE `pages` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`text` text collate utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
INSERT INTO `pages` (`id`, `text`) VALUES (1, '<h2>Join the Fun!</h2>\n<p>All over the world, we're celebrating the launch of Firefox 2. Join the fun by hosting or attending a party. We're targeting the weekend of October 27th for the shared celebration, but if you're hosting, you make the call.</p>\n\n<p>To join the fun, <a href="/users/register">register</a> for a Firefox Party account, and sign up to host or attend.</p>\n\n<p style="border: 1px solid #555; background: #faffd4; padding: 5px; font-weight: bold">Be one of the first 50 party hosts registered and get three extra launch exclusive t-shirts with your purchase of the <a href="">Firefox 2 Party Pack</a>. We're selling the party packs and shirts at cost, so it's a great deal, and for parties with unusually large attendance, we'll be sending out additional swag for door prizes and other give-aways. Stay tuned for updates!</p>');
|
||||
INSERT INTO `pages` (`id`, `text`) VALUES (2, '1162007940');
|
||||
|
||||
CREATE TABLE `parties` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`owner` int(10) NOT NULL default '0',
|
||||
`name` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`vname` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`address` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`tz` int(2) NOT NULL default '0',
|
||||
`website` text collate utf8_unicode_ci NOT NULL,
|
||||
`notes` text collate utf8_unicode_ci NOT NULL,
|
||||
`date` int(10) NOT NULL default '0',
|
||||
`duration` tinyint(2) NOT NULL default '2',
|
||||
`confirmed` tinyint(1) NOT NULL default '1',
|
||||
`canceled` tinyint(1) NOT NULL default '0',
|
||||
`guestcomments` tinyint(1) NOT NULL default '0',
|
||||
`inviteonly` tinyint(1) NOT NULL default '0',
|
||||
`invitecode` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`lat` float NOT NULL default '0',
|
||||
`long` float NOT NULL default '0',
|
||||
`zoom` tinyint(2) NOT NULL default '1',
|
||||
`useflickr` tinyint(1) NOT NULL default '0',
|
||||
`flickrperms` tinyint(1) NOT NULL default '0',
|
||||
`flickrid` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`flickrusr` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE `sessions` (
|
||||
`id` varchar(255) character set latin1 NOT NULL default '',
|
||||
`data` text character set latin1,
|
||||
`expires` int(11) default NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` int(10) NOT NULL auto_increment,
|
||||
`role` tinyint(1) NOT NULL default '0',
|
||||
`email` varchar(255) collate utf8_unicode_ci NOT NULL,
|
||||
`active` varchar(10) collate utf8_unicode_ci NOT NULL default '0',
|
||||
`password` varchar(75) collate utf8_unicode_ci NOT NULL default '',
|
||||
`salt` varchar(9) collate utf8_unicode_ci NOT NULL default '',
|
||||
`name` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`location` tinytext collate utf8_unicode_ci NOT NULL,
|
||||
`tz` tinyint(2) NOT NULL default '0',
|
||||
`website` text collate utf8_unicode_ci NOT NULL,
|
||||
`lat` float NOT NULL default '0',
|
||||
`long` float NOT NULL default '0',
|
||||
`zoom` tinyint(2) NOT NULL default '1',
|
||||
`showemail` tinyint(1) NOT NULL default '0',
|
||||
`showloc` tinyint(1) NOT NULL default '1',
|
||||
`showmap` tinyint(1) NOT NULL default '1',
|
||||
UNIQUE KEY `email` (`email`),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
@@ -1,163 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
uses('sanitize');
|
||||
class AdminController extends AppController {
|
||||
var $name = 'Admin';
|
||||
var $uses = array('Party', 'User', 'Comment');
|
||||
var $components = array('Unicode');
|
||||
|
||||
function beforeFilter() {
|
||||
if (empty($_SESSION['User']) || $_SESSION['User']['role'] != 1) {
|
||||
$this->redirect('/');
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
function index() {
|
||||
$this->set('parties', $this->Party->findAll(null, null, "id ASC"));
|
||||
}
|
||||
|
||||
function users() {
|
||||
$this->set('users', $this->User->findAll(null, null, "id ASC"));
|
||||
}
|
||||
|
||||
function comments() {
|
||||
$this->set('comments', $this->Comment->findAll(null, null, "id ASC"));
|
||||
}
|
||||
|
||||
function edit($type, $id) {
|
||||
if (empty($this->data)) {
|
||||
switch($type) {
|
||||
case 'user':
|
||||
$this->User->id = $id;
|
||||
$user = $this->User->read();
|
||||
$this->set('user', $user);
|
||||
$this->data = $user;
|
||||
break;
|
||||
|
||||
case 'party':
|
||||
$this->Party->id = $id;
|
||||
$party = $this->Party->read();
|
||||
$this->set('party', $party);
|
||||
$this->data = $party;
|
||||
$this->data['Party']['name'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['name']));
|
||||
$this->data['Party']['vname'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['vname']));
|
||||
$this->data['Party']['website'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['website']));
|
||||
$this->data['Party']['address'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['address']));
|
||||
$this->data['Party']['notes'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['notes']));
|
||||
$this->data['Party']['flickrusr'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['flickrusr']));
|
||||
break;
|
||||
|
||||
case 'comment':
|
||||
$this->Comment->id = $id;
|
||||
$comment = $this->Comment->read();
|
||||
$this->set('comment', $comment);
|
||||
|
||||
$uid = $this->User->findById($comment['Comment']['owner']);
|
||||
$this->set('owner', $uid['User']['name']);
|
||||
|
||||
$this->data = $comment;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
switch($type) {
|
||||
case 'user':
|
||||
$this->User->id = $id;
|
||||
$this->User->save($this->data);
|
||||
break;
|
||||
|
||||
case 'party':
|
||||
$this->Party->id = $id;
|
||||
$clean = new Sanitize();
|
||||
$clean->cleanArray($this->data);
|
||||
$this->Party->save($this->data);
|
||||
break;
|
||||
|
||||
case 'comment':
|
||||
$this->Comment->id = $id;
|
||||
$this->Comment->save($this->data);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type != 'party')
|
||||
$this->redirect('/admin/'.$type.'s');
|
||||
|
||||
else
|
||||
$this->redirect('/admin/');
|
||||
}
|
||||
}
|
||||
|
||||
function delete($type, $id) {
|
||||
switch($type) {
|
||||
case 'user':
|
||||
$this->User->del($id);
|
||||
$this->User->query("DELETE FROM guests WHERE uid = $id");
|
||||
break;
|
||||
|
||||
case 'party':
|
||||
$this->Party->del($id);
|
||||
$this->Party->query("DELETE FROM guests WHERE pid = $id");
|
||||
$this->Party->query("DELETE FROM comments WHERE assoc = $id");
|
||||
break;
|
||||
|
||||
case 'comment':
|
||||
$this->Comment->del($id);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($type != 'party')
|
||||
$this->redirect('/admin/'.$type.'s');
|
||||
|
||||
else
|
||||
$this->redirect('/admin/');
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
uses('sanitize');
|
||||
|
||||
class CommentsController extends AppController {
|
||||
var $name = 'Comments';
|
||||
var $components = array('Security');
|
||||
|
||||
function beforeFilter() {
|
||||
$this->Security->requirePost('add');
|
||||
}
|
||||
|
||||
function add($pid, $uid) {
|
||||
if (!$this->Session->check('User') || $uid != $_SESSION['User']['id'])
|
||||
$this->redirect('/');
|
||||
|
||||
if (!empty($this->data) && $this->Comment->canComment($pid, $uid)) {
|
||||
// Explictly destroy the last model to avoid an edit instead of an insert
|
||||
$this->Comment->create();
|
||||
|
||||
$clean = new Sanitize();
|
||||
$text = $clean->html($this->data['Comment']['text']);
|
||||
$this->data['Comment']['text'] = nl2br($text);
|
||||
$this->data['Comment']['owner'] = $uid;
|
||||
$this->data['Comment']['assoc'] = $pid;
|
||||
$this->data['Comment']['time'] = mktime();
|
||||
|
||||
if ($this->Comment->save($this->data)) {
|
||||
$this->redirect('/parties/view/'.$pid.'#c'.$this->Comment->getLastInsertID());
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
$this->redirect('/parties/view/'.$pid);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class HashComponent extends Object {
|
||||
|
||||
function password($pass, $data) {
|
||||
$string = $pass.uniqid(rand(), true).$data;
|
||||
$salt = substr(md5($string), 0, 9);
|
||||
$p = sha1($pass.$salt);
|
||||
$rv = array('pass' => $p, 'salt' => $salt);
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function keygen($chars) {
|
||||
$key = null;
|
||||
$pool = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
for ($i = 0; $i < $chars; $i++)
|
||||
$key .= $pool{rand(0,61)};
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
<?php
|
||||
class MailComponent extends Object {
|
||||
var $from;
|
||||
var $to;
|
||||
var $reply;
|
||||
var $subject;
|
||||
var $message;
|
||||
var $envelope;
|
||||
var $head = "<strong>Firefox Party!</strong><br/>";
|
||||
var $foot;
|
||||
|
||||
|
||||
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('reply', $params))
|
||||
$this->reply = $params['reply'];
|
||||
|
||||
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'];
|
||||
|
||||
if (array_key_exists('type', $params)) {
|
||||
switch($params['type']) {
|
||||
case 'act':
|
||||
$this->message = $this->head."<br/>\nThank you for registering! To activate your account, <a href=\"".$params['link']."\">click here</a> or paste the link below into your browser:<br/> ".$params['link'].$this->foot;
|
||||
break;
|
||||
|
||||
case 'prec':
|
||||
$this->message = $this->head."<br/>\nTo reset your password, <a href=\"".$params['link']."\">click here</a> or paste the link below into your browser:<br/> ".$params['link'].$this->foot;
|
||||
break;
|
||||
|
||||
case 'invite':
|
||||
$this->message = $this->head."<br/>\nYou've been invited by a friend to join them in celebrating the release of Firefox 2. Simply <a href=\"".$params['link']."\">click here</a> to confirm or cancel this invitation. If you don't already have an account, you'll need to create one.\n
|
||||
If you're unable to use the link above, simply paste the following URL into your browser: ".$params['link'].$this->foot;
|
||||
break;
|
||||
|
||||
case 'cancel':
|
||||
$this->message = $this->head."<br/>\nThe party you were attending has been canceled. For more information, please <a href=\"".$params['link']."\">click here</a>, or see the link below.\n ".$params['link'].$this->foot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
if (!empty($this->reply))
|
||||
$headers .= "Reply-To: {$this->reply}\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());
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class UnicodeComponent extends Object {
|
||||
/**
|
||||
* Unicode utilities. Converts and encodes characters up to 0xFFFF (65535)
|
||||
*/
|
||||
function unicode2utf($char) {
|
||||
if ($char < 128) {
|
||||
$rv = chr($char);
|
||||
}
|
||||
|
||||
else if ($char < 2048) {
|
||||
$rv = chr(192 + (($char - ($char % 64)) / 64));
|
||||
$rv .= chr(128 + ($char % 64));
|
||||
}
|
||||
|
||||
else {
|
||||
$rv = chr(224 + (($char - ($char % 4096)) / 4096));
|
||||
$rv .= chr(128 + ((($char % 4096) - ($char % 64)) / 64));
|
||||
$rv .= chr(128 + ($char % 64));
|
||||
}
|
||||
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function utf2unicode($char) {
|
||||
if (ord($char{0}) < 128)
|
||||
$rv = ord($char);
|
||||
|
||||
else if (ord($char{0}) < 224)
|
||||
$rv = ((ord($char{0}) - 192) * 64) + (ord($char{1}) - 128);
|
||||
|
||||
else if (ord($char{0}) < 240)
|
||||
$rv = ((ord($char{0}) - 224) * 4096) + ((ord($char{1}) - 128) * 64 + (ord($char{2}) - 128));
|
||||
|
||||
else
|
||||
$rv = ((ord($char{0}) - 240) * 262144) + ((ord($char{1}) - 128) * 4096) + ((ord($char{2}) - 128) * 64) + (ord($char{3}) - 128);
|
||||
|
||||
return $rv;
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
vendor('webServices');
|
||||
class FeedsController extends AppController {
|
||||
var $name = 'Feeds';
|
||||
var $components = array('Unicode');
|
||||
|
||||
function index() {
|
||||
header('Content-type: application/rss+xml');
|
||||
$this->layout = 'ajax';
|
||||
$this->set('count', $this->Feed->findCount());
|
||||
}
|
||||
|
||||
function latest() {
|
||||
header('Content-type: application/rss+xml');
|
||||
$this->layout = 'ajax';
|
||||
$this->set('latest', $this->Feed->findAll('', '', 'id DESC', 10, 1));
|
||||
}
|
||||
|
||||
function users() {
|
||||
header('Content-type: application/rss+xml');
|
||||
$this->layout = 'ajax';
|
||||
$this->set('count', $this->Feed->getUserCount());
|
||||
}
|
||||
|
||||
function comments($id = null) {
|
||||
$this->layout = 'ajax';
|
||||
header('Content-type: application/rss+xml');
|
||||
if (!is_numeric($id))
|
||||
return;
|
||||
|
||||
$this->set('comments', $this->Feed->getComments($id));
|
||||
$this->set('pid', $id);
|
||||
}
|
||||
|
||||
function photos($id = null) {
|
||||
$this->layout = 'ajax';
|
||||
header('Content-type: application/atom+xml');
|
||||
if (!is_numeric($id))
|
||||
return;
|
||||
|
||||
$party = $this->Feed->findById($id);
|
||||
$this->set('party', $party);
|
||||
|
||||
if (FLICKR_API_KEY != null && !$party['Feeds']['canceled']) {
|
||||
if ($party['Feeds']['useflickr'] == 1) {
|
||||
$data = array('type' => 'flickr', 'userid' => $party['Feeds']['flickrid'], 'randomize' => false);
|
||||
$flickr = new webServices($data);
|
||||
$photoset = $flickr->fetchPhotos(FLICKR_TAG_PREFIX.$id, 30, !$party['Feeds']['flickrperms']);
|
||||
$this->set('flickr', $photoset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function upcoming($limit = null) {
|
||||
$this->layout = 'ajax';
|
||||
header('Content-type: application/rss+xml');
|
||||
|
||||
($limit == null) ? $limit = 25 : $limit = intval($limit);
|
||||
|
||||
$this->set('latest', $this->Feed->findAll('WHERE date > '. time(), '', 'date ASC', $limit, 1));
|
||||
}
|
||||
|
||||
function ical() {
|
||||
$this->layout = 'ajax';
|
||||
header('Content-type: text/calendar');
|
||||
header("Content-Disposition: inline; filename=partylist.ics");
|
||||
$back = time() - 172800;
|
||||
$events = $this->Feed->findAll('WHERE date > '. $back, '', 'date ASC', null, 1);
|
||||
|
||||
$cal = array();
|
||||
|
||||
foreach($events as $event) {
|
||||
$event['Feeds']['name'] =
|
||||
preg_replace(array("/&#(\d{2,5});/e", "/(\n|\r|\f)/", "/\,/"),
|
||||
array('$this->Unicode->unicode2utf(${1})', ' ', '\,'),
|
||||
html_entity_decode($event['Feeds']['name']));
|
||||
$event['Feeds']['address'] =
|
||||
preg_replace(array("/&#(\d{2,5});/e", "/(\n|\r|\f)/", "/\,/"),
|
||||
array('$this->Unicode->unicode2utf(${1})', ' ', '\,'),
|
||||
html_entity_decode($event['Feeds']['address']));
|
||||
$event['Feeds']['notes'] =
|
||||
preg_replace(array("/&#(\d{2,5});/e", "/(\n|\r|\f)/", "/\,/"),
|
||||
array('$this->Unicode->unicode2utf(${1})', ' ', '\,'),
|
||||
html_entity_decode($event['Feeds']['notes']));
|
||||
array_push($cal, $event);
|
||||
}
|
||||
$this->set('events', $cal);
|
||||
}
|
||||
|
||||
function topguests($limit = null) {
|
||||
$this->layout = 'ajax';
|
||||
header('Content-type: application/rss+xml');
|
||||
|
||||
($limit == null) ? $limit = 25 : $limit = intval($limit);
|
||||
|
||||
$rv = $this->Feed->query("SELECT parties.name AS name,
|
||||
guests.pid AS id,
|
||||
COUNT(guests.pid) AS count
|
||||
FROM guests
|
||||
LEFT JOIN parties
|
||||
ON guests.pid = parties.id
|
||||
GROUP BY guests.pid
|
||||
ORDER BY count DESC
|
||||
LIMIT $limit");
|
||||
$this->set('items', $rv);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
uses('sanitize');
|
||||
class PagesController extends AppController {
|
||||
var $name = 'Pages';
|
||||
var $components = array('Unicode');
|
||||
|
||||
function display() {
|
||||
$this->pageTitle = 'Home';
|
||||
$this->set('current', 'home');
|
||||
$this->set('pcount', $this->Page->findCount());
|
||||
$this->set('ucount', $this->Page->getUsers());
|
||||
$text = $this->Page->query('SELECT text FROM pages WHERE id = 1');
|
||||
$time = $this->Page->query('SELECT text FROM pages WHERE id = 2');
|
||||
$this->set('time', $time[0]['pages']['text']);
|
||||
$this->set('front_text', preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($text[0]['pages']['text'])));
|
||||
}
|
||||
|
||||
function privacy() {
|
||||
$this->pageTitle = 'Privacy Policy';
|
||||
}
|
||||
|
||||
function edit() {
|
||||
if (isset($_SESSION['User']['id']) && $_SESSION['User']['role'] == 1) {
|
||||
if (empty($this->data)) {
|
||||
$text = $this->Page->query('SELECT text FROM pages WHERE id = 1');
|
||||
$time = $this->Page->query('SELECT text FROM pages WHERE id = 2');
|
||||
$this->data['Pages']['text'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($text[0]['pages']['text']));
|
||||
$this->set('selected', date('Y-m-d H:i:s', $time[0]['pages']['text']));
|
||||
}
|
||||
|
||||
else {
|
||||
// Paranoid? Nah...
|
||||
if ($_SESSION['User']['role'] == 1) {
|
||||
$clean = new Sanitize();
|
||||
$clean->cleanArray($this->data);
|
||||
$date = mktime($this->data['Pages']['date_hour'],
|
||||
$this->data['Pages']['date_min'],
|
||||
0,
|
||||
$this->data['Pages']['date_month'],
|
||||
$this->data['Pages']['date_day'],
|
||||
$this->data['Pages']['date_year']);
|
||||
|
||||
$this->Page->execute('UPDATE pages SET text = "'.$this->data['Pages']['text'].'" WHERE pages.id = 1');
|
||||
$this->Page->execute('UPDATE pages SET text = "'.$date.'" WHERE pages.id = 2');
|
||||
$this->redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,472 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
uses('sanitize');
|
||||
vendor('webServices');
|
||||
class PartiesController extends AppController {
|
||||
var $name = 'Parties';
|
||||
var $uses = array('Party', 'Comment');
|
||||
var $helpers = array('Html', 'Form');
|
||||
var $components = array('Hash', 'Mail', 'Unicode');
|
||||
|
||||
function index() {
|
||||
$this->pageTitle = 'Party Map';
|
||||
$this->set('current', 'map');
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$gcoder = new webServices(array('type' => 'geocode'));
|
||||
$loc = $gcoder->geocode($this->data['Party']['mloc']);
|
||||
|
||||
if ($loc)
|
||||
$this->set('map', 'initMashUp('.$loc['lat'].', '.$loc['lng'].');');
|
||||
|
||||
else
|
||||
$this->set('map', 'initMashUp();');
|
||||
}
|
||||
|
||||
else
|
||||
$this->set('map', 'initMashUp();');
|
||||
}
|
||||
|
||||
function add() {
|
||||
if (!$this->Session->check('User'))
|
||||
$this->redirect('/users/login');
|
||||
|
||||
$this->pageTitle = 'Create Party';
|
||||
$this->set('current', 'create');
|
||||
$this->set('map', 'mapInit()');
|
||||
|
||||
if(empty($this->data)) {
|
||||
$this->set('utz', $_SESSION['User']['tz']);
|
||||
$this->render();
|
||||
}
|
||||
|
||||
else {
|
||||
$temp = array('lat' => $this->data['Party']['lat'],
|
||||
'long' => $this->data['Party']['long'],
|
||||
'tz' => $this->data['Party']['tz']);
|
||||
|
||||
$clean = new Sanitize();
|
||||
$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']);
|
||||
$this->set('utz', $this->data['Party']['tz']);
|
||||
|
||||
// Convert the selected time to GMT
|
||||
$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']['duration'] = intval($this->data['Party']['duration']);
|
||||
|
||||
$this->data['Party']['invitecode'] = $this->Hash->keygen(10);
|
||||
$this->data['Party']['owner'] = $_SESSION['User']['id'];
|
||||
|
||||
if (!preg_match("/^(http|https)\:\/\//i", $this->data['Party']['website']) &&
|
||||
!empty($this->data['Party']['website']))
|
||||
$this->Party->invalidate('website');
|
||||
|
||||
if ($this->Party->validates($this->data)) {
|
||||
if($this->Party->save($this->data)) {
|
||||
$this->Session->setFlash('Your party has been created!', 'infoFlash');
|
||||
$this->redirect('/parties/view/'.$this->Party->getLastInsertId());
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$this->Session->setFlash('Please correct the errors below.', 'errorFlash');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function edit($id) {
|
||||
$this->Party->id = $id;
|
||||
$party = $this->Party->read();
|
||||
$this->set('party', $party);
|
||||
$this->pageTitle = 'Edit Party';
|
||||
$this->set('current', 'create');
|
||||
|
||||
if (empty($_SESSION['User']['id']))
|
||||
$this->redirect('/users/login/');
|
||||
|
||||
if ($party['Party']['owner'] != $_SESSION['User']['id'])
|
||||
$this->redirect('/parties/view/'.$id);
|
||||
|
||||
else {
|
||||
if (empty($this->data)) {
|
||||
$this->data = $party;
|
||||
|
||||
$date = array('hour' => intval(date('h', $party['Party']['date'])),
|
||||
'min' => intval(date('i', $party['Party']['date'])),
|
||||
'mon' => intval(date('m', $party['Party']['date'])),
|
||||
'day' => intval(date('d', $party['Party']['date'])),
|
||||
'year' => intval(date('Y', $party['Party']['date'])),
|
||||
'tz' => $party['Party']['tz']);
|
||||
|
||||
$this->set('date', $date);
|
||||
$this->data['Party']['name'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['name']));
|
||||
$this->data['Party']['vname'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['vname']));
|
||||
$this->data['Party']['website'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['website']));
|
||||
$this->data['Party']['address'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['address']));
|
||||
$this->data['Party']['notes'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['notes']));
|
||||
$this->data['Party']['flickrusr'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['Party']['flickrusr']));
|
||||
|
||||
if (GMAP_API_KEY != null) {
|
||||
if ($this->data['Party']['lat'])
|
||||
$this->set('map', 'mapInit('.$this->data['Party']['lat'].','.$this->data['Party']['long'].','.$this->data['Party']['zoom'].')');
|
||||
else
|
||||
$this->set('map', 'mapInit()');
|
||||
}
|
||||
}
|
||||
|
||||
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'] = $party['Party']['owner'];
|
||||
$this->data['Party']['duration'] = intval($this->data['Party']['duration']);
|
||||
|
||||
$date = array('hour' => intval(date('h', $party['Party']['date'])),
|
||||
'min' => intval(date('i', $party['Party']['date'])),
|
||||
'mon' => intval(date('m', $party['Party']['date'])),
|
||||
'day' => intval(date('d', $party['Party']['date'])),
|
||||
'year' => intval(date('Y', $party['Party']['date'])),
|
||||
'tz' => $party['Party']['tz']);
|
||||
$this->set('date', $date);
|
||||
|
||||
if (!preg_match("/^(http|https)\:\/\//i", $this->data['Party']['website']) &&
|
||||
!empty($this->data['Party']['website']))
|
||||
$this->Party->invalidate('website');
|
||||
|
||||
if ($this->data['Party']['flickrusr'] != $party['Party']['flickrusr']) {
|
||||
$params = array('type' => 'flickr', 'username' => $this->data['Party']['flickrusr']);
|
||||
$flick = new webServices($params);
|
||||
$this->data['Party']['flickrid'] = $flick->getFlickrId();
|
||||
}
|
||||
|
||||
if ($this->Party->validates($this->data)) {
|
||||
if ($this->Party->save($this->data)) {
|
||||
$this->Session->setFlash('Party edited successfully.', 'infoFlash');
|
||||
$this->redirect('parties/view/'.$id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function view($id = null, $page = null) {
|
||||
if ($id == 'all') {
|
||||
$this->pageTitle = 'All Parties';
|
||||
$this->set('current', 'parties');
|
||||
|
||||
//Paginate!
|
||||
$count = $this->Party->findCount();
|
||||
$pages = ceil($count/100);
|
||||
if ($page == null)
|
||||
$page = 1;
|
||||
if ($page > 1)
|
||||
$this->set('prev', $page - 1);
|
||||
if ($page < $pages)
|
||||
$this->set('next', $page + 1);
|
||||
|
||||
$deck = $this->Party->findAll(null, null, "id ASC", 100, $page);
|
||||
shuffle($deck);
|
||||
$this->set('parties', $deck);
|
||||
}
|
||||
|
||||
else if (is_numeric($id)) {
|
||||
$party = $this->Party->findById($id);
|
||||
if (empty($party['Party']['id']))
|
||||
$this->redirect('/parties/view/all');
|
||||
|
||||
$this->set('current', 'parties');
|
||||
$this->set('host', $this->Party->getHost($party['Party']['owner']));
|
||||
$this->set('party', $party);
|
||||
$this->set('isguest', $this->Party->isGuest($id, @$_SESSION['User']['id']));
|
||||
$this->pageTitle = $party['Party']['name'];
|
||||
$this->set('map', 'mapInit('.$party['Party']['lat'].','.$party['Party']['long'].
|
||||
','.$party['Party']['zoom'].',\'stationary\')');
|
||||
$this->set('guests', $this->Party->getGuests($party['Party']['id']));
|
||||
$this->set('comments', $this->Party->getComments($id));
|
||||
|
||||
if (FLICKR_API_KEY != null) {
|
||||
if ($party['Party']['useflickr'] == 1) {
|
||||
$data = array('type' => 'flickr', 'userid' => $party['Party']['flickrid'], 'randomize' => true);
|
||||
$flickr = new webServices($data);
|
||||
$photoset = $flickr->fetchPhotos(FLICKR_TAG_PREFIX.$party['Party']['id'], 15, (($party['Party']['flickrperms']) ? false : true));
|
||||
$this->set('flickr', array_slice($photoset, 0, 9));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
$this->redirect('/parties/view/all');
|
||||
}
|
||||
|
||||
function invite($id = null) {
|
||||
$this->pageTitle = "Invite a Guest";
|
||||
if (is_numeric($id)) {
|
||||
$party = $this->Party->findById($id);
|
||||
if (empty($party['Party']['id']) ||
|
||||
$party['Party']['owner'] != $_SESSION['User']['id'] ||
|
||||
$party['Party']['canceled'] == 1)
|
||||
$this->redirect('/parties/view/all');
|
||||
|
||||
else {
|
||||
$this->set('partyid', $party['Party']['id']);
|
||||
$this->set('inviteurl', APP_BASE.'/parties/invited/'.$party['Party']['invitecode']);
|
||||
|
||||
$clean = new Sanitize();
|
||||
$uid = $clean->sql($_SESSION['User']['id']);
|
||||
$email = $this->Party->query("SELECT email FROM users WHERE id = ".$uid);
|
||||
|
||||
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'],
|
||||
'reply' => $email[0]['users']['email'],
|
||||
'subject' => 'You\'ve been invited to '.APP_NAME.'!',
|
||||
'link' => APP_BASE.'/parties/invited/'.$party['Party']['invitecode'],
|
||||
'type' => 'invite');
|
||||
|
||||
$this->Mail->mail($message);
|
||||
$this->Mail->send();
|
||||
|
||||
$this->Session->setFlash($this->data['Party']['einvite'].' has been
|
||||
invited. You can invite another guest below or <a href="'.APP_BASE.'/parties/view/'.$id.'/">click here</a>
|
||||
to return to your party.', 'infoFlash');
|
||||
$this->data['Party']['einvite'] = null;
|
||||
}
|
||||
else {
|
||||
$this->validateErrors($this->Party);
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function invited($icode = null, $conf = null) {
|
||||
$this->pageTitle = "Confirm Invite";
|
||||
if ($icode == 'cancel') {
|
||||
$this->Session->delete('invite');
|
||||
$this->Session->delete('invitestep');
|
||||
$this->redirect('/');
|
||||
}
|
||||
|
||||
else {
|
||||
$clean = new Sanitize();
|
||||
$icode = $clean->sql($icode);
|
||||
$party = $this->Party->findByInvitecode($icode);
|
||||
|
||||
if (empty($party['Party']['id'])) {
|
||||
$this->Session->setFlash('Could not find a party matching that invite code, please check it and try again.', 'errorFlash');
|
||||
}
|
||||
|
||||
else {
|
||||
if (!empty($_SESSION['User']['id']) && !empty($_SESSION['invitestep']) && $conf == 'confirm') {
|
||||
$this->Party->addGuest($_SESSION['User']['id'], $_SESSION['invite']);
|
||||
$this->Session->setFlash('You have been successfully added to this party.', 'infoFlash');
|
||||
$this->redirect('/parties/view/'.$party['Party']['id']);
|
||||
}
|
||||
|
||||
else if (!empty($_SESSION['User']['id'])) {
|
||||
$this->set('confirm_only', true);
|
||||
$this->set('party', $party);
|
||||
$this->set('icode', $icode);
|
||||
$this->Session->write('invitestep', 'true');
|
||||
$this->Session->write('invite', $icode);
|
||||
}
|
||||
|
||||
else {
|
||||
$this->Session->write('invite', $icode);
|
||||
$this->set('party', $party);
|
||||
$this->set('icode', $icode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function rsvp($pid) {
|
||||
if (is_numeric($pid) && isset($_SESSION['User']['id'])) {
|
||||
$party = $this->Party->findById($pid);
|
||||
if (empty($party['Party']['id'])) {
|
||||
$this->Session->setFlash('Invalid party id.', 'errorFlash');
|
||||
$this->redirect('/parties/view/all');
|
||||
}
|
||||
|
||||
else {
|
||||
if ($party['Party']['inviteonly']) {
|
||||
$this->Session->setFlash('This party invite only, you\'ll need an
|
||||
invitation from the host to join in', 'errorFlash');
|
||||
}
|
||||
|
||||
else {
|
||||
$this->Party->rsvp($pid, $_SESSION['User']['id']);
|
||||
$this->Session->setFlash('You have been successfully added to this party.', 'infoFlash');
|
||||
$this->redirect('/parties/view/'.$pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
$this->redirect('/parties/view/all');
|
||||
}
|
||||
|
||||
function unrsvp($pid) {
|
||||
if (is_numeric($pid) && isset($_SESSION['User']['id'])) {
|
||||
$party = $this->Party->findById($pid);
|
||||
if (empty($party['Party']['id'])) {
|
||||
$this->Session->setFlash('Invalid party id.', 'errorFlash');
|
||||
$this->redirect('/parties/view/all');
|
||||
}
|
||||
|
||||
else {
|
||||
$this->Party->unrsvp($pid, $_SESSION['User']['id']);
|
||||
$this->Session->setFlash('You have been successfully removed from this party.', 'infoFlash');
|
||||
$this->redirect('/parties/view/'.$pid);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
$this->redirect('/parties/view/all');
|
||||
}
|
||||
|
||||
function cancel($pid) {
|
||||
$this->pageTitle = "Cancel Party";
|
||||
if (!is_numeric($pid) || !isset($_SESSION['User']['id']))
|
||||
$this->redirect('/');
|
||||
|
||||
else
|
||||
$this->set('pid', $pid);
|
||||
|
||||
$party = $this->Party->findById($pid);
|
||||
if ($_SESSION['User']['id'] != $party['Party']['owner'])
|
||||
die();
|
||||
|
||||
if (!empty($this->data) && $_SESSION['User']['id'] == $party['Party']['owner']) {
|
||||
if ($this->data['Party']['confcancel'] == 1) {
|
||||
$guests = $this->Party->getGuests($pid);
|
||||
$guest_count = count($guests);
|
||||
|
||||
foreach($guests as $guest) {
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $guest['users']['email'],
|
||||
'reply' => $_SESSION['User']['email'],
|
||||
'subject' => 'Party Cancellation Notice',
|
||||
'link' => APP_BASE.'/parties/view/'.$pid,
|
||||
'type' => 'cancel');
|
||||
|
||||
$this->Mail->mail($message);
|
||||
$this->Mail->send();
|
||||
}
|
||||
|
||||
$this->Party->query("DELETE FROM guests WHERE pid = $pid LIMIT $guest_count");
|
||||
$this->Party->query("UPDATE parties SET canceled = '1', invitecode = '0' WHERE parties.id = $pid LIMIT 1");
|
||||
|
||||
$this->redirect('/parties/view/'.$pid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function uncancel($pid) {
|
||||
if (!is_numeric($pid) || !isset($_SESSION['User']['id']))
|
||||
$this->redirect('/');
|
||||
|
||||
$party = $this->Party->findById($pid);
|
||||
if ($_SESSION['User']['id'] != $party['Party']['owner'])
|
||||
die();
|
||||
|
||||
$key = $this->Hash->keygen(10);
|
||||
$this->Party->query("UPDATE parties SET canceled = '0', invitecode = '$key' WHERE parties.id = $pid LIMIT 1");
|
||||
$this->redirect('/parties/view/'.$pid);
|
||||
}
|
||||
|
||||
function js($type = null, $data = null) {
|
||||
$this->layout = 'ajax';
|
||||
|
||||
if ($type == 'html') {
|
||||
header('Content-type: text/plain');
|
||||
$party = $this->Party->findById($data);
|
||||
$this->set('party', $party);
|
||||
}
|
||||
|
||||
else {
|
||||
header('Content-type: text/javascript');
|
||||
$parties = $this->Party->findAll();
|
||||
$this->set('parties', $parties);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,437 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
uses('sanitize');
|
||||
class UsersController extends AppController {
|
||||
var $name = 'Users';
|
||||
var $uses = array('User', 'Party');
|
||||
var $helpers = array('Html', 'Form');
|
||||
var $components = array('Security', 'Hash', 'Mail');
|
||||
|
||||
function index() {
|
||||
if (!isset($_SESSION['User'])) {
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
|
||||
$this->pageTitle = 'My Profile';
|
||||
|
||||
$user = $this->Session->read('User');
|
||||
$this->set('parties', $this->User->memberOf($user['id']));
|
||||
$this->set('hparties', $this->User->hostOf($user['id']));
|
||||
$this->set('iparties', $this->User->invitedTo($user['id']));
|
||||
}
|
||||
|
||||
function register() {
|
||||
$this->pageTitle = 'Register';
|
||||
$this->set('map', 'mapInit()');
|
||||
|
||||
if(empty($this->data)) {
|
||||
$this->set('utz', '0');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
else {
|
||||
if ($this->User->findByEmail($this->data['User']['email']))
|
||||
$this->User->invalidate('email');
|
||||
|
||||
if ($this->data['User']['email'] !== $this->data['User']['confemail'])
|
||||
$this->User->invalidate('confemail');
|
||||
|
||||
if (!preg_match("/^(http|https)\:\/\//i", $this->data['User']['website']) &&
|
||||
!empty($this->data['User']['website']))
|
||||
$this->User->invalidate('website');
|
||||
|
||||
if ($this->data['User']['password'] !== $this->data['User']['confpass'])
|
||||
$this->User->invalidate('confpass');
|
||||
|
||||
if (empty($this->data['User']['password']) || empty($this->data['User']['confpass']))
|
||||
$this->User->invalidate('password');
|
||||
|
||||
// Repopulate the timezone with right value in case there's a validation error
|
||||
$this->set('utz', $this->data['User']['tz']);
|
||||
|
||||
if ($this->User->validates($this->data)) {
|
||||
$clean = new Sanitize();
|
||||
// Generate and set the password, salt and activation key
|
||||
$pass = $this->Hash->password($this->data['User']['password'],
|
||||
$this->data['User']['email']);
|
||||
$this->data['User']['active'] = $this->Hash->keygen(10);
|
||||
$this->data['User']['password'] = $pass['pass'];
|
||||
$this->data['User']['salt'] = $pass['salt'];
|
||||
|
||||
// Save a few fields from the wrath of cleanArray()
|
||||
$temp = array('lat' => $this->data['User']['lat'],
|
||||
'long' => $this->data['User']['long'],
|
||||
'tz' => $this->data['User']['tz'],
|
||||
'email' => $this->data['User']['email']);
|
||||
// Scrub 'a dub
|
||||
$clean->cleanArray($this->data);
|
||||
$this->data['User']['email'] = $temp['email'];
|
||||
$this->data['User']['long'] = floatval($temp['long']);
|
||||
$this->data['User']['lat'] = floatval($temp['lat']);
|
||||
$this->data['User']['tz'] = intval($temp['tz']);
|
||||
$this->data['User']['role'] = 0;
|
||||
|
||||
if($this->User->save($this->data)) {
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $this->data['User']['email'],
|
||||
'subject' => 'Your '.APP_NAME.' Registration',
|
||||
'link' => APP_BASE.'/users/activate/'.$this->data['User']['active'],
|
||||
'type' => 'act');
|
||||
$this->Mail->mail($message);
|
||||
$this->Mail->send();
|
||||
|
||||
if (isset($_SESSION['invite']))
|
||||
$this->Party->addGuest($this->User->getLastInsertId(), $_SESSION['invite']);
|
||||
|
||||
$this->Session->setFlash('Thank you for registering! To login, you\'ll
|
||||
need to activate your account. Please check
|
||||
your email for your activation link.', 'infoFlash');
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
|
||||
else {
|
||||
$this->data['User']['password'] = null;
|
||||
$this->data['User']['confpass'] = null;
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$this->data['User']['password'] = null;
|
||||
$this->data['User']['confpass'] = null;
|
||||
$this->Session->setFlash('There was an error in your submission. Please
|
||||
correct the errors shown below and try again.',
|
||||
'errorFlash');
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function edit() {
|
||||
if (!isset($_SESSION['User'])) {
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
$this->set('error', false);
|
||||
$this->pageTitle = 'Edit My Account';
|
||||
if (empty($this->data)) {
|
||||
$this->User->id = $_SESSION['User']['id'];
|
||||
$this->data = $this->User->read();
|
||||
$this->data['User']['password'] = "";
|
||||
$this->set('utz', $this->data['User']['tz']);
|
||||
|
||||
$this->data['User']['name'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['User']['name']));
|
||||
$this->data['User']['website'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['User']['website']));
|
||||
$this->data['User']['location'] = preg_replace("/&#(\d{2,5});/e",
|
||||
'$this->Unicode->unicode2utf(${1})',
|
||||
html_entity_decode($this->data['User']['location']));
|
||||
|
||||
if (GMAP_API_KEY != null) {
|
||||
if ($this->data['User']['lat'])
|
||||
$this->set('map', 'mapInit('.$this->data['User']['lat'].','.$this->data['User']['long'].','.$this->data['User']['zoom'].')');
|
||||
else
|
||||
$this->set('map', 'mapInit()');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$user = $this->User->findById($_SESSION['User']['id']);
|
||||
$this->User->id = $user['User']['id'];
|
||||
$this->set('utz', $user['User']['tz']);
|
||||
|
||||
$clean = new Sanitize();
|
||||
$temp = array('password' => $this->data['User']['password'],
|
||||
'confpassword' => $this->data['User']['confpassword'],
|
||||
'lat' => $clean->sql($this->data['User']['lat']),
|
||||
'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'] = $user['User']['email'];
|
||||
$this->data['User']['password'] = $temp['password'];
|
||||
$this->data['User']['confpassword'] = $temp['confpassword'];
|
||||
$this->data['User']['lat'] = floatval($temp['lat']);
|
||||
$this->data['User']['long'] = floatval($temp['long']);
|
||||
$this->data['User']['tz'] = intval($temp['tz']);
|
||||
$this->data['User']['role'] = $user['User']['role'];
|
||||
|
||||
if (!preg_match("/^(http|https)\:\/\//i", $this->data['User']['website']) &&
|
||||
!empty($this->data['User']['website']))
|
||||
$this->User->invalidate('website');
|
||||
|
||||
if ($this->data['User']['password'] === $this->data['User']['confpassword'] &&
|
||||
!empty($this->data['User']['password'])) {
|
||||
$pass = $this->Hash->password($this->data['User']['password'], $user['User']['email']);
|
||||
$this->data['User']['password'] = $pass['pass'];
|
||||
$this->data['User']['salt'] = $pass['salt'];
|
||||
}
|
||||
|
||||
else if (empty($this->data['User']['password']) && empty($this->data['User']['confpassword'])) {
|
||||
$this->data['User']['password'] = $user['User']['password'];
|
||||
$this->data['User']['salt'] = $user['User']['salt'];
|
||||
}
|
||||
|
||||
else {
|
||||
$this->set('error', true);
|
||||
$this->User->invalidate('password');
|
||||
$this->User->invalidate('confpassword');
|
||||
}
|
||||
|
||||
if ($this->User->validates($this->data)) {
|
||||
if ($this->User->save($this->data)) {
|
||||
$sess = $this->User->findById($user['User']['id']);
|
||||
$this->redirect('/users/');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$this->validateErrors($this->User);
|
||||
$this->data['User']['password'] = null;
|
||||
$this->data['User']['confpassword'] = null;
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function login() {
|
||||
if ($this->Session->Check('User'))
|
||||
$this->redirect('/users');
|
||||
|
||||
$this->pageTitle = 'Login';
|
||||
if (!empty($this->data)) {
|
||||
if (empty($this->data['User']['email']) || empty($this->data['User']['password']))
|
||||
$this->render();
|
||||
|
||||
$user = $this->User->findByEmail($this->data['User']['email']);
|
||||
$pass = sha1($this->data['User']['password'].$user['User']['salt']);
|
||||
|
||||
if ($user['User']['password'] == $pass) {
|
||||
if ($user['User']['active'] != 1) {
|
||||
$this->Session->setFlash('Your account hasn\'t been activated yet. Please
|
||||
check your email (including junk/spam folders)
|
||||
for your activation link, or click <a href="'
|
||||
.APP_BASE.'/users/recover/activate">here</a> to
|
||||
resend your activation details.', 'infoFlash');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
else {
|
||||
if (isset($_SESSION['invite']))
|
||||
$this->Party->addGuest($user['User']['id'], $_SESSION['invite']);
|
||||
|
||||
$this->Session->write('User', $user['User']);
|
||||
$this->redirect('/users/');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$this->Session->setFlash('The email address and password you supplied do
|
||||
not match. Please try again.', 'errorFlash');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!is_numeric($id))
|
||||
$this->redirect('/');
|
||||
|
||||
else {
|
||||
$user = $this->User->findById($id);
|
||||
$this->pageTitle = $user['User']['name'];
|
||||
$this->set('user', $user);
|
||||
if (GMAP_API_KEY != null && !empty($user['User']['lat']))
|
||||
$this->set('map', 'mapInit('.$user['User']['lat'].','.$user['User']['long'].','.$user['User']['zoom'].',\'stationary\');');
|
||||
|
||||
$this->Party->unbindModel(array('hasMany' => array('Comment')));
|
||||
$this->set('hparties', $this->User->hostOf($id));
|
||||
$att = $this->User->query('SELECT parties.id, parties.name
|
||||
FROM parties
|
||||
LEFT JOIN guests
|
||||
ON parties.id = guests.pid
|
||||
WHERE guests.uid = '.$id);
|
||||
$this->set('parties', $att);
|
||||
}
|
||||
}
|
||||
|
||||
function logout() {
|
||||
$this->Session->destroy();
|
||||
$this->Session->delete('User');
|
||||
$this->redirect('/');
|
||||
}
|
||||
|
||||
function recover($aType = null, $aCode = null, $aId = null) {
|
||||
switch ($aType) {
|
||||
case "password":
|
||||
$this->pageTitle = "Password Recovery";
|
||||
$this->set('atitle', 'Password Recovery');
|
||||
$this->set('hideInput', false);
|
||||
$this->set('url', 'password');
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$user = $this->User->findByEmail($this->data['User']['email']);
|
||||
|
||||
if (!isset($user['User']['email'])) {
|
||||
$this->Session->setFlash('Could not find a user with that email address. Please check it and try again.', 'errorFlash');
|
||||
$this->render();
|
||||
}
|
||||
else {
|
||||
$code = md5($user['User']['salt'].$user['User']['email'].$user['User']['password']);
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $user['User']['email'],
|
||||
'subject' => APP_NAME.' Password Request',
|
||||
'link' => APP_BASE.'/users/recover/password/'.$code.'/'.$user['User']['id'],
|
||||
'type' => 'prec');
|
||||
|
||||
$this->Mail->mail($message);
|
||||
$this->Mail->send();
|
||||
$this->Session->setFlash('An email has been sent to '.$user['User']['email'].' with reset instructions.', 'errorFlash');
|
||||
$this->redirect('users/login');
|
||||
}
|
||||
}
|
||||
|
||||
if ($aCode !== null && $aId !== null) {
|
||||
$this->set('hideInput', true);
|
||||
$this->set('reset', false);
|
||||
$user = $this->User->findById($aId);
|
||||
|
||||
if (!$user) {
|
||||
$this->Session->setFlash('Invalid request. Please check the URL and try again.', 'errorFlash');
|
||||
$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->Session->setFlash('Invalid request. Please check the URL and try again.', 'errorFlash');
|
||||
$this->render();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "activate":
|
||||
$this->pageTitle = 'Resend Activation Code';
|
||||
$this->set('atitle', 'Resend Activation Code');
|
||||
$this->set('hideInput', false);
|
||||
$this->set('url', 'activate');
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$user = $this->User->findByEmail($this->data['User']['email']);
|
||||
|
||||
if (!$user) {
|
||||
$this->Session->setFlash('Could not find a user with that email address. Please check it and try again.', 'errorFlash');
|
||||
$this->render();
|
||||
}
|
||||
|
||||
if ($user['User']['active'] == 1)
|
||||
$this->redirect('/users/login');
|
||||
|
||||
else {
|
||||
$message = array('from' => APP_NAME.' <'.APP_EMAIL.'>',
|
||||
'envelope' => APP_EMAIL,
|
||||
'to' => $this->data['User']['email'],
|
||||
'subject' => 'Your '.APP_NAME.' Registration',
|
||||
'link' => APP_BASE.'/users/activate/'.$user['User']['active'],
|
||||
'type' => 'act');
|
||||
$this->Mail->mail($message);
|
||||
$this->Mail->send();
|
||||
$this->Session->setFlash('Your activation code has been resent.', 'infoFlash');
|
||||
$this->redirect('users/login');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "reset":
|
||||
if ($aCode !== null && $aId !== null) {
|
||||
if (!empty($this->data)) {
|
||||
$user = $this->User->findById($aId);
|
||||
if (!$user) {
|
||||
$this->Session->setFlash('Invalid request. Please check the URL and try again.', 'errorFlash');
|
||||
$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);
|
||||
$this->data['User']['password'] = sha1($this->data['User']['password'] . $this->data['User']['salt']);
|
||||
$this->data['User']['id'] = $aId;
|
||||
if ($this->User->save($this->data)) {
|
||||
$this->Session->setFlash('Your password has been reset.', 'infoFlash');
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->redirect('/');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function activate($aKey = null) {
|
||||
if ($aKey == null)
|
||||
$this->redirect('/');
|
||||
|
||||
else {
|
||||
$user = $this->User->findByActive($aKey);
|
||||
if (empty($user['User']['id'])) {
|
||||
$this->Session->setFlash('Your account could not be activated. Please make
|
||||
sure the URL entered is correct and try again.', 'errorFlash');
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
|
||||
else {
|
||||
$this->data = $user;
|
||||
$this->data['User']['active'] = 1;
|
||||
|
||||
if ($this->User->save($this->data)) {
|
||||
$this->Session->setFlash('Your account was successfully activated.', 'infoFlash');
|
||||
$this->redirect('/users/login');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
/* SVN FILE: $Id: index.php,v 1.3 2006-10-08 03:39:21 reed%reedloden.com Exp $ */
|
||||
/**
|
||||
* 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
|
||||
* @since CakePHP v 0.10.0.1076
|
||||
* @version $Revision: 1.3 $
|
||||
* @modifiedby $LastChangedBy: phpnut $
|
||||
* @lastmodified $Date: 2006-10-08 03:39:21 $
|
||||
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
||||
*/
|
||||
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
|
||||
?>
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Admin extends AppModel {
|
||||
var $name = 'Admin';
|
||||
var $useTable = "parties";
|
||||
}
|
||||
?>
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Comment extends AppModel {
|
||||
var $name = 'Comment';
|
||||
|
||||
var $validate = array(
|
||||
'text' => "/^\S/"
|
||||
);
|
||||
|
||||
function canComment($pid, $uid) {
|
||||
$status = $this->query('SELECT owner, guestcomments FROM parties WHERE id = '.$pid);
|
||||
$guest = null;
|
||||
if ($status[0]['parties']['owner'] != $uid)
|
||||
$guest = $this->query('SELECT uid FROM guests WHERE pid = '.$pid.' AND uid = '.$uid);
|
||||
|
||||
if ($status[0]['parties']['guestcomments'] == 1) {
|
||||
if (!empty($guest[0]['guests']['uid']) || $uid == $status[0]['parties']['owner'])
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Feed extends AppModel {
|
||||
var $name = 'Feeds';
|
||||
var $useTable = "parties";
|
||||
|
||||
function getComments($aParty) {
|
||||
$rv = $this->query("SELECT * FROM comments WHERE assoc = ".$aParty." LIMIT 10");
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function getUserCount() {
|
||||
$rv = $this->query("SELECT COUNT(*) FROM users");
|
||||
return $rv[0][0]['COUNT(*)'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Guest extends AppModel {
|
||||
var $name = 'Guest';
|
||||
}
|
||||
?>
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Page extends AppModel {
|
||||
var $name = 'Page';
|
||||
var $useTable = 'parties';
|
||||
|
||||
function getUsers() {
|
||||
$rv = $this->query("SELECT COUNT(*) FROM users");
|
||||
return $rv[0][0]["COUNT(*)"];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class Party extends AppModel {
|
||||
var $name = 'Party';
|
||||
var $validate = array(
|
||||
'name' => "/^\S/",
|
||||
'einvite' => VALID_EMAIL,
|
||||
'duration' => VALID_NUMBER
|
||||
);
|
||||
|
||||
function getComments($pid) {
|
||||
$rv = $this->query("SELECT users.id AS uid, users.name,
|
||||
comments.id AS cid, comments.time, comments.text
|
||||
FROM users, parties, comments
|
||||
WHERE comments.assoc = ".$pid."
|
||||
AND users.id = comments.owner
|
||||
AND parties.id = ".$pid."
|
||||
ORDER BY cid ASC");
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function getHost($uid) {
|
||||
$rv = $this->query("SELECT name FROM users WHERE id = ".$uid);
|
||||
return @$rv[0]['users']['name'];
|
||||
}
|
||||
|
||||
function isGuest($pid, $uid) {
|
||||
$rv = $this->query('SELECT id FROM guests WHERE uid = '.$uid.' AND pid = '.$pid);
|
||||
if (!empty($rv[0]['guests']['id']))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function getGuests($pid) {
|
||||
$rv = $this->query("SELECT users.id, users.name, users.email, guests.invited
|
||||
FROM users
|
||||
LEFT JOIN guests
|
||||
ON users.id = guests.uid
|
||||
WHERE guests.pid = ".$pid);
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function rsvp($pid, $uid) {
|
||||
$party = $this->findById($pid);
|
||||
if (!empty($party['Party']['id']) && !$this->isGuest($pid, $uid)) {
|
||||
$this->query("INSERT INTO guests (id, pid, uid, invited)
|
||||
VALUES (NULL, ".$party['Party']['id'].", ".$uid.", 0)");
|
||||
}
|
||||
}
|
||||
|
||||
function unrsvp($pid, $uid) {
|
||||
$party = $this->findById($pid);
|
||||
if (!empty($party['Party']['id']) && $this->isGuest($pid, $uid)) {
|
||||
$this->query('DELETE FROM guests WHERE uid = '.$uid.' AND pid = '.$pid);
|
||||
}
|
||||
}
|
||||
|
||||
function addGuest($uid, $icode) {
|
||||
$party = $this->findByInvitecode($icode);
|
||||
if (!empty($party['Party']['id'])) {
|
||||
$check = $this->query('SELECT uid FROM guests WHERE uid = '.$uid.'
|
||||
AND pid = '.$party['Party']['id']);
|
||||
if (empty($check[0]['guests']['uid']) && $uid != $party['Party']['owner']) {
|
||||
$this->query("INSERT INTO guests (id, pid, uid, invited)
|
||||
VALUES (NULL, ".$party['Party']['id'].", ".$uid.", 1)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function findByInvitecode($icode) {
|
||||
$rv = $this->query('SELECT * FROM parties AS Party WHERE invitecode = "'.$icode.'" LIMIT 1');
|
||||
return @$rv[0];
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class User extends AppModel {
|
||||
var $name = 'User';
|
||||
var $validate = array(
|
||||
'email' => VALID_EMAIL,
|
||||
'name' => "/^\S/"
|
||||
);
|
||||
|
||||
function memberOf($uid) {
|
||||
$rv = $this->query('SELECT parties.id, parties.name FROM guests, parties WHERE guests.uid = '.$uid.' AND parties.id = guests.pid');
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function hostOf($uid) {
|
||||
$rv = $this->query('SELECT id, name FROM parties WHERE owner = '.$uid);
|
||||
return $rv;
|
||||
}
|
||||
|
||||
function invitedTo($uid) {
|
||||
$rv = $this->query('SELECT parties.id, parties.name FROM guests, parties WHERE guests.uid = '.$uid.' AND parties.id = guests.pid AND guests.invited = 1');
|
||||
return $rv;
|
||||
}
|
||||
}
|
||||
?>
|
||||
199
mozilla/webtools/partytool/vendors/webServices.php
vendored
@@ -1,199 +0,0 @@
|
||||
<?php
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Party Tool
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ryan Flint <rflint@dslr.net>
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
class webServices {
|
||||
|
||||
var $userid;
|
||||
var $host;
|
||||
var $randomize;
|
||||
|
||||
function webServices($data) {
|
||||
switch ($data['type']) {
|
||||
case "flickr":
|
||||
$this->host = "api.flickr.com";
|
||||
|
||||
if (array_key_exists('userid', $data))
|
||||
$this->userid = $data['userid'];
|
||||
|
||||
if (array_key_exists('randomize', $data))
|
||||
$this->randomize = $data['randomize'];
|
||||
|
||||
if (array_key_exists('username', $data)) {
|
||||
$head = "GET /services/rest/?method=flickr.people.findByUsername&api_key=".FLICKR_API_KEY."&username=".$data['username']." HTTP/1.1\r\n";
|
||||
$head .= "Host: ".$this->host."\r\n";
|
||||
$head .= "Connection: Close\r\n\r\n";
|
||||
|
||||
if ($results = $this->fetchResults($head)) {
|
||||
preg_match('/nsid=\"(.*)\"/', $results, $matches);
|
||||
if ($matches[1]) {
|
||||
$this->userid = $matches[1];
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "gsuggest":
|
||||
$this->host = "api.google.com";
|
||||
break;
|
||||
|
||||
case "geocode":
|
||||
$this->host = "maps.google.com";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function getFlickrId() {
|
||||
return $this->userid;
|
||||
}
|
||||
|
||||
function fetchPhotos($tags, $num_results, $single_user) {
|
||||
$params = array('api_key' => FLICKR_API_KEY,
|
||||
'method' => 'flickr.photos.search',
|
||||
'format' => 'php_serial',
|
||||
'tags' => $tags,
|
||||
'per_page' => $num_results);
|
||||
|
||||
if ($single_user)
|
||||
$params['user_id'] = $this->userid;
|
||||
|
||||
$encoded_params = array();
|
||||
foreach ($params as $k => $v)
|
||||
$encoded_params[] = urlencode($k).'='.urlencode($v);
|
||||
|
||||
$head = 'GET /services/rest/?'.implode('&', $encoded_params)." HTTP/1.1 \r\n";
|
||||
$head .= 'Host: '.$this->host."\r\n";
|
||||
$head .= "Connection: Close\r\n\r\n";
|
||||
|
||||
if ($results = $this->fetchResults($head)) {
|
||||
$resp = split("\r\n\r\n", $results);
|
||||
$data = unserialize($resp[1]);
|
||||
|
||||
if ($data['stat'] == 'ok') {
|
||||
$arr = array();
|
||||
for ($i = 0; $i < count($data['photos']['photo']); $i++) {
|
||||
$p = $data['photos']['photo'][$i];
|
||||
$arr[$i] = array('id' => $p['id'],
|
||||
'owner' => $p['owner'],
|
||||
'secret' => $p['secret'],
|
||||
'server' => $p['server'],
|
||||
'farm' => $p['farm'],
|
||||
'title' => $p['title']);
|
||||
}
|
||||
|
||||
if ($this->randomize) {
|
||||
// Randomize the results
|
||||
shuffle($arr);
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
function GSuggest($phrase) {
|
||||
$soapy = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>
|
||||
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
||||
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
|
||||
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
|
||||
<SOAP-ENV:Body>
|
||||
<doSpellingSuggestion xmlns="urn:GoogleSearch">
|
||||
<key xsi:type="xsd:string">'.GSEARCH_API_KEY.'</key>
|
||||
<phrase xsi:type="xsd:string">'.$phrase.'</phrase>
|
||||
</doSpellingSuggestion>
|
||||
</SOAP-ENV:Body>
|
||||
</SOAP-ENV:Envelope>';
|
||||
|
||||
$head = "POST /search/beta2 HTTP/1.1\r\n";
|
||||
$head .= "Host: api.google.com\r\n";
|
||||
$head .= "MessageType: CALL\r\n";
|
||||
$head .= "Content-type: text/xml\r\n";
|
||||
$head .= "Content-length: ".strlen($soapy)."\r\n";
|
||||
$head .= "Connection: Close\r\n\r\n";
|
||||
$head .= $soapy;
|
||||
|
||||
if ($results = $this->fetchResults($head)) {
|
||||
if (preg_match('/return xsi:type="xsd:string">(.*)</', $results, $matches))
|
||||
return $matches[1];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function geocode($query) {
|
||||
$head = "GET /maps/geo?q=".urlencode($query)."&output=xml&key=".GMAP_API_KEY." HTTP/1.1\r\n";
|
||||
$head .= "Host: maps.google.com\r\n";
|
||||
$head .= "Connection: Close\r\n\r\n";
|
||||
|
||||
if ($results = $this->fetchResults($head)) {
|
||||
if (stristr($results, '<code>200</code>')) {
|
||||
preg_match('/coordinates>(.*)</', $results, $matches);
|
||||
$ll = explode(',', $matches[1]);
|
||||
$rv = array('lat' => $ll[1], 'lng' => $ll[0]);
|
||||
return $rv;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function fetchResults($headers) {
|
||||
$fs = fsockopen($this->host, 80, $errno, $errstr, 30);
|
||||
if (!$fs)
|
||||
return 0;
|
||||
|
||||
else {
|
||||
fwrite($fs, $headers);
|
||||
stream_set_timeout($fs, 2);
|
||||
|
||||
$buffer = null;
|
||||
while (!feof($fs))
|
||||
$buffer .= fgets($fs, 128);
|
||||
|
||||
fclose($fs);
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,18 +0,0 @@
|
||||
<h1>Comments</h1>
|
||||
<p>Switch view to: <a href="<?php echo $html->url('/admin/'); ?>">Parties»</a> <a href="<?php echo $html->url('/admin/users'); ?>">Users»</a></p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Text</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php foreach($comments as $comment): ?>
|
||||
<tr>
|
||||
<td><a href="<?php echo $html->url('/parties/view/'.$comment['Comment']['assoc'].'#c'.$comment['Comment']['id']); ?>"><?php echo $comment['Comment']['id']; ?></a></td>
|
||||
<td><?php echo $comment['Comment']['text']; ?></td>
|
||||
<td><a href="<?php echo $html->url('/admin/edit/comment/'.$comment['Comment']['id']); ?>">Edit</a></td>
|
||||
<td><a href="<?php echo $html->url('/admin/delete/comment/'.$comment['Comment']['id']); ?>" onclick="return confirm('Delete comment <?php echo $comment['Comment']['id']; ?>?')">Delete</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
@@ -1,128 +0,0 @@
|
||||
<?php if (isset($user)): ?>
|
||||
<h1><?php echo $user['User']['name'].' (<a href="'.$html->url('/users/view/'.$user['User']['id']).'">'.$user['User']['id']; ?></a>)</h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/admin/edit/user/'.$user['User']['id']); ?>" method="post">
|
||||
<div>
|
||||
<label for="UserName" class="label-large">Name:</label>
|
||||
<?php echo $html->input('User/name', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserRole" class="label-large">Admin privileges:</label>
|
||||
<?php echo $html->checkbox('User/role'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserEmail" class="label-large">Email address:</label>
|
||||
<?php echo $html->input('User/email', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserWebsite" class="label-large">Website:</label>
|
||||
<?php echo $html->input('User/website', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserActive" class="label-large">Activation code:</label>
|
||||
<?php echo $html->input('User/active', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="location" class="label-large">Location:</label>
|
||||
<?php echo $html->input('User/location', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserShowemail" class="label-large">Show email:</label>
|
||||
<?php echo $html->checkbox('User/showemail'); ?><br/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserShowloc" class="label-large">Show location:</label>
|
||||
<?php echo $html->checkbox('User/showloc'); ?><br/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserShowmap" class="label-large">Show map:</label>
|
||||
<?php echo $html->checkbox('User/showmap'); ?><br/>
|
||||
</div>
|
||||
<?php echo $html->hidden('User/id', array('value' => $user['User']['id'])).$html->submit('Submit'); ?>
|
||||
</form>
|
||||
|
||||
<?php endif; if (isset($party)): ?>
|
||||
<h1><?php echo $party['Party']['name'].' (<a href="'.$html->url('/parties/view/'.$party['Party']['id']).'">'.$party['Party']['id']; ?></a>)</h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/admin/edit/party/'.$party['Party']['id']); ?>" method="post">
|
||||
<div>
|
||||
<label for="PartyOwner" class="label-large">Party Owner:</label>
|
||||
<?php echo $html->input('Party/owner', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyName" class="label-large">Party Name:</label>
|
||||
<?php echo $html->input('Party/name', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyVname" class="label-large">Venue Name:</label>
|
||||
<?php echo $html->input('Party/vname', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyWebsite" class="label-large">Web site:</label>
|
||||
<?php echo $html->input('Party/website', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyAddress" class="label-large">Address:</label>
|
||||
<?php echo $html->input('Party/address', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyDate" class="label-large">Date:</label>
|
||||
<?php echo $html->input('Party/date', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyNotes" class="label-large">Additional Notes:</label>
|
||||
<?php echo $html->textarea('Party/notes', array('rows' => 10, 'cols' => 50)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyConfirmed" class="label-large">Time:</label>
|
||||
<?php echo $html->radio('Party/confirmed', array(0 => 'Tentative', 1 => 'Confirmed')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyDuration" class="label-large">Duration (in hours):</label>
|
||||
<?php echo $html->input('Party/duration', array('size' => 5)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyCanceled" class="label-large">Canceled:</label>
|
||||
<?php echo $html->checkbox('Party/canceled'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyUseflickr" class="label-large">Use Flickr:</label>
|
||||
<?php echo $html->checkbox('Party/useflickr'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyFlickrperms" class="label-large">Show:</label>
|
||||
<?php echo $html->radio('Party/flickrperms', array(0 => 'Only my photos', 1 => 'Anyone\'s photos')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyFlickrusr" class="label-large">Flickr username:</label>
|
||||
<?php echo $html->input('Party/flickrusr', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyFlickrusr" class="label-large">Flickr id:</label>
|
||||
<?php echo $html->input('Party/flickrid', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyInviteonly" class="label-large">Invite only:</label>
|
||||
<?php echo $html->checkbox('Party/inviteonly'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyGuestcomments" class="label-large">Limit comments to party guests only:</label>
|
||||
<?php echo $html->checkbox('Party/guestcomments'); ?>
|
||||
</div>
|
||||
<br/>
|
||||
<?php echo $html->hidden('Party/id', array('value' => $party['Party']['id'])).$html->submit('Submit'); ?>
|
||||
</form>
|
||||
|
||||
<?php endif; if(isset($comment)): ?>
|
||||
<h1>Comment <?php echo '<a href="'.$html->url('/parties/view/'.$comment['Comment']['assoc'].'#c'.$comment['Comment']['id']).'">#'.$comment['Comment']['id']; ?></a> by <?php echo '<a href="'.$html->url('/users/view/'.$comment['Comment']['owner']).'">'.$owner; ?></a></h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/admin/edit/comment/'.$comment['Comment']['id']); ?>" method="post">
|
||||
<div>
|
||||
<label for="CommentAssoc" class="label-large">Party:</label>
|
||||
<?php echo $html->input('Comment/assoc', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="CommentText" class="label-large">Text:</label>
|
||||
<?php echo $html->textarea('Comment/text', array('rows' => 10, 'cols' => 50)); ?>
|
||||
</div>
|
||||
<?php echo $html->hidden('Comment/id', array('value' => $comment['Comment']['id'])).$html->submit('Submit'); ?>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -1,18 +0,0 @@
|
||||
<h1>Parties</h1>
|
||||
<p>Switch view to: <a href="<?php echo $html->url('/admin/users'); ?>">Users»</a> <a href="<?php echo $html->url('/admin/comments'); ?>">Comments»</a></p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Name</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php foreach($parties as $party): ?>
|
||||
<tr>
|
||||
<td><a href="<?php echo $html->url('/parties/view/'.$party['Party']['id']); ?>"><?php echo $party['Party']['id']; ?></a></td>
|
||||
<td><?php echo $party['Party']['name']; ?></td>
|
||||
<td><a href="<?php echo $html->url('/admin/edit/party/'.$party['Party']['id']); ?>">Edit</a></td>
|
||||
<td><a href="<?php echo $html->url('/admin/delete/party/'.$party['Party']['id']); ?>" onclick="return confirm('Delete party <?php echo $party['Party']['id']; ?>?')">Delete</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
@@ -1,18 +0,0 @@
|
||||
<h1>Users</h1>
|
||||
<p>Switch view to: <a href="<?php echo $html->url('/admin/'); ?>">Parties»</a> <a href="<?php echo $html->url('/admin/comments'); ?>">Comments»</a></p>
|
||||
<table>
|
||||
<tr>
|
||||
<td>ID</td>
|
||||
<td>Name</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<?php foreach($users as $user): ?>
|
||||
<tr>
|
||||
<td><a href="<?php echo $html->url('/users/view/'.$user['User']['id']); ?>"><?php echo $user['User']['id']; ?></a></td>
|
||||
<td><?php echo $user['User']['name']; ?></td>
|
||||
<td><a href="<?php echo $html->url('/admin/edit/user/'.$user['User']['id']); ?>">Edit</a></td>
|
||||
<td><a href="<?php echo $html->url('/admin/delete/user/'.$user['User']['id']); ?>" onclick="return confirm('Delete user <?php echo $user['User']['id']; ?>?')">Delete</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php if(!isset($_SESSION['User'])): ?>
|
||||
<strong>Welcome, Guest!</strong>
|
||||
<a href="<?php echo $html->url('/users/login'); ?>">Login</a> | <a href="<?php echo $html->url('/users/register'); ?>">Register</a>
|
||||
<?php else: ?>
|
||||
<strong>Welcome, <?php echo $_SESSION['User']['name']; ?>!</strong>
|
||||
<a href="<?php echo $html->url('/users'); ?>">My Account</a> | <a href="<?php echo $html->url('/users/logout'); ?>">Logout</a>
|
||||
<?php endif; ?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Latest Comments"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/'.$pid); ?></link>
|
||||
<title><?php echo APP_NAME." - Latest Comments"; ?></title>
|
||||
<?php foreach($comments as $comment): ?>
|
||||
<item>
|
||||
<title><![CDATA[<?php echo substr($comment['comments']['text'], 0, 25).'...'; ?>]]></title>
|
||||
<description><?php echo $comment['comments']['text'] ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/'.$comment['comments']['assoc'].'#c'.$comment['comments']['id']); ?></link>
|
||||
</item>
|
||||
<?php endforeach; ?>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,22 +0,0 @@
|
||||
BEGIN:VCALENDAR
|
||||
X-WR-CALNAME:<?php echo APP_NAME."\n"; ?>
|
||||
X-WR-CALDESC:Upcoming Parties
|
||||
PRODID:-//MozillaPartyTool//calendar//EN
|
||||
VERSION:2.0
|
||||
CALSCALE:GREGORIAN
|
||||
METHOD:PUBLISH
|
||||
<?php foreach($events as $event):
|
||||
if ($event['Feeds']['canceled']) continue; ?>
|
||||
BEGIN:VEVENT
|
||||
UID:<?php echo APP_BASE.$html->url('/parties/view/'.$event['Feeds']['id'])."\n"; ?>
|
||||
DTSTAMP:<?php echo gmdate('Ymd\This\Z', $event['Feeds']['date'])."\n"; ?>
|
||||
LOCATION:<?php echo $event['Feeds']['lat'].'\, '.$event['Feeds']['long'].'('.$event['Feeds']['address'].")\n"; ?>
|
||||
SUMMARY:<?php echo $event['Feeds']['name']."\n"; ?>
|
||||
DTSTART:<?php echo gmdate('Ymd\This', $event['Feeds']['date'])."\n"; ?>
|
||||
DURATION:PT<?php echo $event['Feeds']['duration']; ?>H
|
||||
URL:<?php echo APP_BASE.$html->url('/parties/view/'.$event['Feeds']['id'])."\n"; ?>
|
||||
STATUS:<?php echo (($event['Feeds']['confirmed'] == 1) ? "CONFIRMED" : "TENTATIVE")."\n"; ?>
|
||||
DESCRIPTION: <?php echo $event['Feeds']['name'].'\n '.$event['Feeds']['address'].'\n '.date('h:ia', $event['Feeds']['date']).'\n '.$event['Feeds']['notes'].'\n'."\n"; ?>
|
||||
END:VEVENT
|
||||
<?php endforeach; ?>
|
||||
END:VCALENDAR
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Party Count"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/'); ?></link>
|
||||
<title><?php echo APP_NAME." - Party Count"; ?></title>
|
||||
<item>
|
||||
<title><?php echo $count; ?></title>
|
||||
<description>Total Parties</description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/all/'); ?></link>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Latest Parties"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/'); ?></link>
|
||||
<title><?php echo APP_NAME." - Latest Parties"; ?></title>
|
||||
<?php foreach($latest as $party):
|
||||
if ($party['Feeds']['canceled']) continue; ?>
|
||||
<item>
|
||||
<title><?php echo $party['Feeds']['name'] ?></title>
|
||||
<description><?php echo $party['Feeds']['vname'] ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/'.$party['Feeds']['id']); ?></link>
|
||||
</item>
|
||||
<?php endforeach; ?>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php echo '<?xml version="1.0" encoding="utf-8"?>'."\n"; ?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title><?php echo $party['Feeds']['name']; ?></title>
|
||||
<id>tag:<?php echo APP_BASE; ?>,2006:/parties/view/<?php echo $party['Feeds']['id']; ?></id>
|
||||
<subtitle><?php echo APP_NAME; ?> Photostream</subtitle>
|
||||
<updated><?php echo date('Y-m-d\TH:i:s\Z'); ?></updated>
|
||||
<generator uri="http://www.screwedbydesign.com/software/partytool">Mozilla Party Tool</generator>
|
||||
|
||||
<?php foreach ($flickr as $pic): ?>
|
||||
<entry>
|
||||
<title><?php echo $pic['title']; ?></title>
|
||||
<link rel="alternate" type="text/html" href="http://www.flickr.com/photos/<?php echo $pic['owner']."/".$pic['id']."/"; ?>"/>
|
||||
<id>tag:flickr.com,2005:/photo/<?php echo $pic['id']; ?></id>
|
||||
<published><?php echo date('Y-m-d\TH:i:s\Z'); ?></published>
|
||||
<updated><?php echo date('Y-m-d\TH:i:s\Z'); ?></updated>
|
||||
<content type="html"><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']."_m.jpg" ?>" title="<?php echo $pic['title']; ?>"/></a></content>
|
||||
<author>
|
||||
<name><?php echo $pic['owner']; ?></name>
|
||||
<uri>http://www.flickr.com/people/<?php echo $pic['owner']; ?>/</uri>
|
||||
</author>
|
||||
</entry>
|
||||
<?php endforeach; ?>
|
||||
</feed>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Top Guests"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/all'); ?></link>
|
||||
<title><?php echo APP_NAME." - Top Guests"; ?></title>
|
||||
<?php foreach($items as $item):?>
|
||||
<item>
|
||||
<title><?php echo $item['parties']['name'].' ('.$item[0]['count'].')'; ?></title>
|
||||
<description><?php echo $item['parties']['name'].' - '.$item[0]['count'].' guest'.(($item[0]['count'] != 1) ? 's' : ''); ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/'.$item['guests']['id']); ?></link>
|
||||
</item>
|
||||
<?php endforeach; ?>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Upcoming Parties"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/'); ?></link>
|
||||
<title><?php echo APP_NAME." - Upcoming Parties"; ?></title>
|
||||
<?php foreach($latest as $party):
|
||||
if ($party['Feeds']['canceled']) continue; ?>
|
||||
<item>
|
||||
<title><![CDATA[<?php echo $party['Feeds']['name'] ?>]]></title>
|
||||
<description><?php echo date('Y-m-d H:i', $party['Feeds']['date']); ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/parties/view/'.$party['Feeds']['id']); ?></link>
|
||||
</item>
|
||||
<?php endforeach; ?>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<pubDate><?php echo date('r'); ?></pubDate>
|
||||
<description><?php echo APP_NAME." - Total Users"; ?></description>
|
||||
<link><?php echo APP_BASE.$html->url('/'); ?></link>
|
||||
<title><?php echo APP_NAME." - Total Users"; ?></title>
|
||||
<item>
|
||||
<title><?php echo $count; ?></title>
|
||||
<description>Total Users</description>
|
||||
<link><?php echo APP_BASE.$html->url('/'); ?></link>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -1,40 +0,0 @@
|
||||
<?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>
|
||||
<title><?php echo APP_NAME." - ".$title_for_layout?></title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo $html->url('/favicon.ico'); ?>"/>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $html->url('/css/main.css'); ?>"/>
|
||||
<link rel="alternate" type="application/rss+xml" href="<?php echo $html->url('/feeds/latest'); ?>"/>
|
||||
</head>
|
||||
<body<?php echo (isset($map)) ? ' onload="'.$map.'" onunload="GUnload()"' : '';?>>
|
||||
<div id="container">
|
||||
<p class="skipLink"><a href="#content" accesskey="2">Skip to main content</a></p>
|
||||
<div id="mozilla-com"><a href="http://www.mozilla.com/">Visit Mozilla.com</a></div>
|
||||
<div id="header">
|
||||
<div id="key-title">
|
||||
<h1><a href="<?php echo $html->url('/'); ?>" title="Return to home page" accesskey="1"><img src="<?php echo $html->url('/img/firefox-title.png'); ?>" width="276" height="54" alt="Firefox Party"/></a></h1>
|
||||
<div id="user"><?php echo $this->renderElement('user_options'); ?></div>
|
||||
</div>
|
||||
<div id="key-menu">
|
||||
<ul id="menu-firefox">
|
||||
<li<?php echo (@$current == 'home') ? ' class="current"' : ''?>><a href="<?php echo $html->url('/'); ?>">Home</a></li>
|
||||
<li<?php echo (@$current == 'map') ? ' class="current"' : ''?>><a href="<?php echo $html->url('/parties/'); ?>">View Map</a></li>
|
||||
<li<?php echo (@$current == 'parties') ? ' class="current"' : ''?>><a href="<?php echo $html->url('/parties/view/all/'); ?>">View Parties</a></li>
|
||||
<li<?php echo (@$current == 'create') ? ' class="current"' : ''?>><a href="<?php echo $html->url('/parties/add/'); ?>">Create Party</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<?php $this->controller->Session->flash(); ?>
|
||||
|
||||
<?php echo $content_for_layout; ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
Copyright © <?php echo date('Y'); ?> Mozilla<br/>
|
||||
<a href="<?php echo $html->url('/privacy-policy'); ?>">Privacy Policy</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<div id='flash' class='error'><?php echo $content_for_layout ?></div>
|
||||
@@ -1 +0,0 @@
|
||||
<div id='flash' class='info'><?php echo $content_for_layout ?></div>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
$difference = $time - time();
|
||||
$days_left = floor($difference/60/60/24);
|
||||
?>
|
||||
<div id="f-left">
|
||||
<?php echo $front_text;
|
||||
if (@$_SESSION['User']['role'] == 1): ?>
|
||||
<a href="<?php echo $html->url('/pages/edit'); ?>">Edit</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="f-right">
|
||||
<div class="cbox">
|
||||
<span class="ctxt"><?php echo $pcount."</span><br/>".(($pcount == 1) ? ' Party' : ' Parties'); ?>
|
||||
<div class="ifeed">
|
||||
<a style="padding-right: 2px;" title="Party Calendar" href="<?php echo $html->url('/feeds/ical'); ?>"><img src="<?php echo $html->url('/img/ical.png'); ?>" alt="iCAL"/></a><a title="Party Count Feed" href="<?php echo $html->url('/feeds/'); ?>"><img src="<?php echo $html->url('/img/feed16.png'); ?>" alt="RSS"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cbox">
|
||||
<span class="ctxt"><?php echo $ucount."</span><br/>".(($ucount == 1) ? ' Partygoer' : ' Partygoers'); ?>
|
||||
<div class="cfeed">
|
||||
<a title="User Count Feed" href="<?php echo $html->url('/feeds/users/'); ?>"><img src="<?php echo $html->url('/img/feed16.png'); ?>" alt="RSS"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($days_left > 0): ?>
|
||||
<div class="cbox">
|
||||
<span class="ctxt"><?php echo $days_left."</span><br/>".(($days_left == 1) ? ' Day' : ' Days'); ?> until we party!
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
@@ -1,6 +0,0 @@
|
||||
<form action="<?php echo $html->url('/pages/edit'); ?>" method="post">
|
||||
<h1>Front Page Text</h1>
|
||||
<?php echo $html->textarea('Pages/text', array('rows' => 35, 'cols' => 80)); ?>
|
||||
<h1>Countdown Timer</h1>
|
||||
<?php echo $html->dateTimeOptionTag('Pages/date', 'YMD', 24, $selected).'<br/><br/>'.$html->submit('Submit'); ?>
|
||||
</form>
|
||||
@@ -1,42 +0,0 @@
|
||||
<h2>Mozilla Privacy Policy</h2>
|
||||
|
||||
<h3>Website Visitors</h3>
|
||||
|
||||
<p>Except as described below, the Mozilla Foundation and the Mozilla Corporation (collectively "Mozilla") do not collect or require visitors to its Web sites to furnish personally-identifying information such as names, email addresses and phone numbers. Like most Web site operators, Mozilla does collect non-personally-identifying information of the sort that web browsers and servers typically make available, such as the browser type, language preference, referring site, and date and time of each visitor request. Mozilla also collects potentially personally-identifying information like Internet Protocol (IP) addresses, which are non-personally-identifying in and of themselves but could be used in conjunction with other information to personally identify users.</p>
|
||||
|
||||
<p>Mozilla's purpose in collecting this information is to better understand how Mozilla's visitors use its Web sites. To that end, Mozilla may share potentially personally-identifying information with its employees, contractors and affiliated organizations. Mozilla may also release non-personally-identifying information about visitors, e.g. by publishing a report on Web site usage trends. Otherwise, Mozilla will not publicly release potentially personally-identifying information except under the same circumstances as Mozilla releases personally-identifying information. Those circumstances are explained in detail below.</p>
|
||||
|
||||
<h3>Community Members</h3>
|
||||
|
||||
<p>Certain members of the Mozilla community (contributors, customers, etc.) choose to interact with Mozilla in ways that require Mozilla and others to know more about them. The amount and type of information that Mozilla gathers from those members depends on the nature of the interaction. For example, members who wish to post content to certain portions of Mozilla's Web sites are asked to provide usernames that identify that content as having been posted by a particular member. Developers, by comparison, are asked to provide contact information, up to and sometimes including telephone or fax numbers, so that they can be contacted as necessary. Customers of the Mozilla store are asked to provide even more information, including billing and shipping addresses and credit card or similar information. In each case, Mozilla collects personally-identifying information only insofar as is necessary to fulfill the purpose of the community member's interaction with Mozilla.</p>
|
||||
|
||||
<p>Mozilla is an open organization that believes in sharing as much information as possible about its products, its operations and its associations. Accordingly, community members should assume - as should most folks who interact with Mozilla - that any personally-identifying information provided to Mozilla will be made available to the public. There are three broad exceptions to that rule:</p>
|
||||
|
||||
<ol>
|
||||
|
||||
<li>Mozilla does not publicly release information gathered in connection with commercial transactions (i.e., transactions involving money), including transactions conducted through the Mozilla Store.</li>
|
||||
<li>Mozilla does not make publicly available information that is used to authenticate users the publication of which would compromise the security of Mozilla's Web sites (e.g., passwords).</li>
|
||||
<li>Mozilla does not make publicly available information that it specifically promises at the time of collection to maintain in confidence.</li>
|
||||
</ol>
|
||||
|
||||
<p>Outside those three contexts, users should assume that personally-identifying information provided through Mozilla's Web sites will be made available to the public.</p>
|
||||
|
||||
<h3>Interactive Product Features</h3>
|
||||
|
||||
<p>Certain Mozilla products contain features that report, or that permit users to report, the user's usage patterns and problems - whether caused by Mozilla's software, third party software, or third-party Web sites - to Mozilla. The reports generated by these features typically include non-personally-identifying information such as the configuration of the user's computer and the code running at the time the problem occurred. Some of these features give users the option of providing personally-identifying information, though none of these features require it. Some Mozilla software features that do permit users to provide personally-identifying information advise in advance that such information will not be made publicly available. Mozilla analyzes the information provided by these interactive product features to develop a better understanding of how its products are performing and being used. It does not use the information to track the usage of its products by identifiable individuals.</p>
|
||||
|
||||
<h3>Cookies</h3>
|
||||
|
||||
<p>A cookie is a string of information that a Web site stores on a visitor's computer, and that the visitor's browser provides to the Web site each time the visitor returns. Mozilla's Web sites use cookies to help Mozilla identify and track visitors, their usage of Mozilla Web sites, and their Web site access preferences across multiple requests and visits to Mozilla's Web sites. It is possible to link cookies to personally-identifying information, thereby permitting Web site operators to track the online movements of particular individuals. Mozilla, however, does not do so. Instead, it uses the information provided by cookies to develop a better understanding of how Mozilla's visitors use, and to facilitate those visitors' interactions with, Mozilla's Web sites. Mozilla visitors who do not wish to have cookies placed on their computers by Mozilla or its contractors should set their browsers to refuse cookies before linking to Mozilla's Web sites. Certain features of Mozilla's Web sites may not function properly without the aid of cookies.</p>
|
||||
|
||||
<h3>Protection of Certain Personally-Identifying Information</h3>
|
||||
|
||||
<p>Where Mozilla has collected personally-identifying information subject to one of the three exceptions described in the Contributors and Customers section, above, it discloses that information only to those of its employees, contractors and affiliated organizations that need to know that information in order to process it on Mozilla's behalf and that have agreed not to disclose it to others. Some of those employees, contractors and affiliated organizations may be located outside of your home country; by using Mozilla's Web sites, you consent to the transfer of your information to them. Mozilla does not rent or sell such information to anyone. Other than to its employees, contractors and affiliated organizations, as described above, Mozilla discloses such information only when required to do so by law, or when Mozilla believes in good faith that disclosure is reasonably necessary to protect the property or rights of Mozilla, members of the Mozilla community, or the public at large. Mozilla takes all measures reasonably necessary to protect against the unauthorized access, use, alteration or destruction of such information</p>
|
||||
|
||||
<h3>Updating of Personally-Identifying Information</h3>
|
||||
|
||||
<p>Mozilla permits users to freely update and correct their personally-identifying information as maintained by Mozilla. To do so, users need only look for the links and other tools available on Mozilla's Web sites or contact Mozilla by email.</p>
|
||||
|
||||
<h3>Privacy Policy Changes</h3>
|
||||
|
||||
<p>Although changes are likely to be minor, Mozilla may change its Privacy Policy from time to time. Any and all changes will be reflected on this page. Substantive changes will also be announced through the standard mechanisms through which Mozilla communicates with the Mozilla community, including Mozilla's "mozilla-announce" mailing lists.</p>
|
||||
@@ -1,109 +0,0 @@
|
||||
<h1>Create a Party</h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/parties/add'); ?>" method="post">
|
||||
<div>
|
||||
<label for="PartyName" class="label-large">Party Name<span class="required">*</span>:</label>
|
||||
<?php echo $html->input('Party/name', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('Party/name', 'Please enter a party name.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyVname" class="label-large">Venue Name:</label>
|
||||
<?php echo $html->input('Party/vname', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyAddress" class="label-large">Address:</label>
|
||||
<?php echo $html->input('Party/address', array('size' => 40, 'id' => 'location', 'onkeypress' => 'capture(event)', 'onblur' => 'update()')); ?>
|
||||
<div id="locerr" class="info" style="display: none">Did you mean: <a id="locerrlink" onclick="geocode_suggest()" href="#"></a>? <a href="#" onclick="shide()"><span style="font-size: x-small">(close)</span></a></div>
|
||||
</div>
|
||||
<p>Enter your party's time and date (in your local time) here. If you're not ready to commit to a specific time or date, select the 'Tentative'
|
||||
radio button. Otherwise select 'Confirmed'.</p>
|
||||
<div>
|
||||
<label for="PartyYear" class="label-large">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="PartyHour" class="label-large">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')); ?><br/>
|
||||
</div>
|
||||
<p>The timezone is used to calculate the appropriate GMT time from the local time specified above. This is done to show
|
||||
the party in the local time of the person viewing it.</p>
|
||||
<div>
|
||||
<label for="PartyTz" class="label-large">Timezone<span class="required">*</span>:</label>
|
||||
<?php
|
||||
$tzs = array('-12' => 'GMT-12',
|
||||
'-11' => 'GMT-11',
|
||||
'-10' => 'GMT-10',
|
||||
'-9' => 'GMT-9',
|
||||
'-8' => 'GMT-8',
|
||||
'-7' => 'GMT-7',
|
||||
'-6' => 'GMT-6',
|
||||
'-5' => 'GMT-5',
|
||||
'-4' => 'GMT-4',
|
||||
'-3' => 'GMT-3',
|
||||
'-2' => 'GMT-2',
|
||||
'-1' => 'GMT-1',
|
||||
'0' => 'GMT+0',
|
||||
'1' => 'GMT+1',
|
||||
'2' => 'GMT+2',
|
||||
'3' => 'GMT+3',
|
||||
'4' => 'GMT+4',
|
||||
'5' => 'GMT+5',
|
||||
'6' => 'GMT+6',
|
||||
'7' => 'GMT+7',
|
||||
'8' => 'GMT+8',
|
||||
'9' => 'GMT+9',
|
||||
'10' => 'GMT+10',
|
||||
'11' => 'GMT+11',
|
||||
'12' => 'GMT+12',
|
||||
'13' => 'GMT+13');
|
||||
echo $html->selectTag('Party/tz', $tzs, $utz, null, null, false);
|
||||
?>
|
||||
(this page was loaded at <?php echo gmdate("Y-m-d H:i:s"); ?> GMT)
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyDuration" class="label-large">Duration (in hours):</label>
|
||||
<?php echo $html->input('Party/duration', array('size' => 5)); ?>
|
||||
</div>
|
||||
<p>Enter a website (complete with http://) that guests can visit to learn more about your party. If you don't have one, simply leave it blank.</p>
|
||||
<div>
|
||||
<label for="PartyWebsite" class="label-large">Web site:</label>
|
||||
<?php echo $html->input('Party/website', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('Party/website', 'Invalid URL.')?>
|
||||
</div>
|
||||
<p>If you choose to make your party invite only, you will have to send guests an invite containing a random invite code to allow them to join your party.</p>
|
||||
<div>
|
||||
<label for="PartyInviteonly" class="label-large">Invite only</label>
|
||||
<?php echo $html->checkbox('Party/inviteonly'); ?>
|
||||
</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() {
|
||||
var loc = document.getElementById("location").value;
|
||||
geocode(loc);
|
||||
}
|
||||
|
||||
function capture(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
update();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<p>Drag the map or the marker to specify a location. Set the zoom by using the '+' or '-' buttons on the left.</p>
|
||||
<p id="map" class="med-map-r"></p>
|
||||
<?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; ?>
|
||||
<div>
|
||||
<label for="PartyNotes" class="label-large">Additional Notes</label>
|
||||
<?php echo $html->textarea('Party/notes', array('rows' => 10, 'cols' => 50)); ?>
|
||||
</div>
|
||||
<?php echo $html->submit('Create Party'); ?>
|
||||
</form>
|
||||
@@ -1,7 +0,0 @@
|
||||
<h1>Cancel Party</h1>
|
||||
<div class="error">Warning! Canceling your party will remove all guests and send them a cancellation notice.</div>
|
||||
<p>If you're sure you want to cancel your party simply hit the button below. Otherwise,
|
||||
<a href="<?php echo $html->url('/parties/view/'.$pid); ?>">click here</a> to return to your party.</p>
|
||||
<form action="<?php echo $html->url('/parties/cancel/'.$pid); ?>" method="post">
|
||||
<?php echo $html->hidden('Party/confcancel', array('value' => 1)).$html->submit('Cancel Party'); ?>
|
||||
</form>
|
||||
@@ -1,131 +0,0 @@
|
||||
<form class="fxform" action="<?php echo $html->url('/parties/edit/'.$party['Party']['id']); ?>" method="post">
|
||||
<?php echo $html->hidden('Party/id'); ?>
|
||||
<h1>Details</h1>
|
||||
<div>
|
||||
<label for="PartyName" class="label-large">Party Name:</label>
|
||||
<?php echo $html->input('Party/name', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyVname" class="label-large">Venue Name:</label>
|
||||
<?php echo $html->input('Party/vname', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyWebsite" class="label-large">Web site:</label>
|
||||
<?php echo $html->input('Party/website', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('Party/website', 'Invalid URL.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyAddress" class="label-large">Address:</label>
|
||||
<?php echo $html->input('Party/address', array('size' => 40, '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>
|
||||
<p id="map" class="med-map-r"></p>
|
||||
<div>
|
||||
<label for="PartyNotes" class="label-large">Additional Notes:</label>
|
||||
<?php echo $html->textarea('Party/notes', array('rows' => 10, 'cols' => 50)); ?>
|
||||
</div>
|
||||
<h1>Date</h1>
|
||||
<div>
|
||||
<label for="PartyYear" class="label-large">Date:</label>
|
||||
<?php echo $html->yearOptionTag('Party/year', null, date('Y'), MAX_YEAR, $date['year'], null, null, false); ?>-<?php echo $html->hourOptionTag('Party/month', null, false, $date['mon']); ?>-<?php echo $html->dayOptionTag('Party/day', null, $date['day'], null, false); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyHour" class="label-large">Time:</label>
|
||||
<?php echo $html->hourOptionTag('Party/hour', null, true, $date['hour']);?>:<?php echo $html->minuteOptionTag('Party/minute', null, $date['min']);?>
|
||||
<?php echo $html->radio('Party/confirmed', array(0 => 'Tentative', 1 => 'Confirmed')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyTz" class="label-large">Timezone:</label>
|
||||
<?php
|
||||
$tzs = array('-12' => 'GMT-12',
|
||||
'-11' => 'GMT-11',
|
||||
'-10' => 'GMT-10',
|
||||
'-9' => 'GMT-9',
|
||||
'-8' => 'GMT-8',
|
||||
'-7' => 'GMT-7',
|
||||
'-6' => 'GMT-6',
|
||||
'-5' => 'GMT-5',
|
||||
'-4' => 'GMT-4',
|
||||
'-3' => 'GMT-3',
|
||||
'-2' => 'GMT-2',
|
||||
'-1' => 'GMT-1',
|
||||
'0' => 'GMT+0',
|
||||
'1' => 'GMT+1',
|
||||
'2' => 'GMT+2',
|
||||
'3' => 'GMT+3',
|
||||
'4' => 'GMT+4',
|
||||
'5' => 'GMT+5',
|
||||
'6' => 'GMT+6',
|
||||
'7' => 'GMT+7',
|
||||
'8' => 'GMT+8',
|
||||
'9' => 'GMT+9',
|
||||
'10' => 'GMT+10',
|
||||
'11' => 'GMT+11',
|
||||
'12' => 'GMT+12',
|
||||
'13' => 'GMT+13');
|
||||
|
||||
echo $html->selectTag('Party/tz', $tzs, $date['tz'], null, null, false);?>
|
||||
(current time is <?php echo gmdate("Y-m-d H:i:s"); ?>GMT)
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyDuration" class="label-large">Duration (in hours):</label>
|
||||
<?php echo $html->input('Party/duration', array('size' => 5)); ?>
|
||||
</div>
|
||||
<h1><span style="color: #0063dc">flick</span><span style="color: #ff0084">r<sup style="font-size: 8px">TM</sup></span> Options</h1>
|
||||
<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>
|
||||
<div>
|
||||
<label for="PartyUseflickr" class="label-large">Show photostream:</label>
|
||||
<?php echo $html->checkbox('Party/useflickr'); ?>
|
||||
</div>
|
||||
<p>If you choose to show photos from anyone using your party's tag please note that no photos will show until two or more people are using the tag.</p>
|
||||
<div>
|
||||
<label for="PartyFlickrperms" class="label-large">Show:</label>
|
||||
<?php echo $html->radio('Party/flickrperms', array(0 => 'Only my photos', 1 => 'Anyone\'s photos')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyFlickrusr" class="label-large">Flickr username:</label>
|
||||
<?php echo $html->input('Party/flickrusr', array('size' => 40)); ?>
|
||||
</div>
|
||||
<h1>Privacy</h1>
|
||||
<div>
|
||||
<label for="PartyInviteonly" class="label-large">Invite only:</label>
|
||||
<?php echo $html->checkbox('Party/inviteonly'); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="PartyGuestcomments" class="label-large">Limit comments to party guests only:</label>
|
||||
<?php echo $html->checkbox('Party/guestcomments'); ?>
|
||||
</div>
|
||||
<br/>
|
||||
<?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>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php if(GMAP_API_KEY != null): ?>
|
||||
<div style="text-align: center">
|
||||
<form action="<?php echo $html->url('/parties/'); ?>" class="fxform" onsubmit="search(event)" method="post">
|
||||
<label for="PartyMloc"><strong>Find a party:</strong></label>
|
||||
<?php echo $html->input('Party/mloc', array('size' => 60, 'id' => 'location')).' '.$html->submit('Search'); ?>
|
||||
<div id="locerr" class="info" style="display: none">Did you mean: <a id="locerrlink" onclick="geocode_suggest()" href="#"></a>? <a href="#" onclick="shide()"><span style="font-size: x-small">(close)</span></a></div>
|
||||
</form>
|
||||
</div>
|
||||
<br/>
|
||||
<script src="http://maps.google.com/maps?file=api&v=2.67&key=<?php echo GMAP_API_KEY; ?>"
|
||||
type="text/javascript"></script>
|
||||
<script src="<?php echo $html->url('/js/maps.js'); ?>" type="text/javascript"></script>
|
||||
<script src="<?php echo $html->url('/parties/js'); ?>" type="text/javascript"></script>
|
||||
<div id="map" class="large-map"></div>
|
||||
<div id="map-load" style="visibility: hidden" class="load">
|
||||
<img src="<?php echo $html->url('/img/throbber.gif'); ?>"/>
|
||||
Loading...
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -1,9 +0,0 @@
|
||||
<h1>Invite a guest</h1>
|
||||
<p>To invite a guest, simply enter their email address into the field below,
|
||||
or hand them a link to
|
||||
<strong><?php echo $inviteurl; ?></strong></p>
|
||||
<form action="<?php echo $html->url('/parties/invite/'.$partyid) ?>" method="post">
|
||||
<label for="PartyEinvite">Guest's email address:</label>
|
||||
<?php echo $html->input('Party/einvite')."\n".$html->submit('Submit')."\n"; ?>
|
||||
<?php echo $html->tagErrorMsg('Party/einvite', 'Invalid email address')?>
|
||||
</form>
|
||||
@@ -1,36 +0,0 @@
|
||||
<h1>Confirm Invite</h1>
|
||||
<?php if (isset($party) && !isset($confirm_only)): ?>
|
||||
<p>You've been invited to attend <a href="<?php echo $html->url('/parties/view/'.$party['Party']['id']); ?>"><?php echo $party['Party']['name']; ?></a>.
|
||||
To join this party please select one of the options below, or <a href="<?php echo $html->url('/parties/invited/cancel/');?>">click here</a> to cancel this invitation.</p>
|
||||
<div style="text-align: center">
|
||||
<div style="width: 50%; float: left;">
|
||||
<h2>New User</h2>
|
||||
<p>Simply register for an account, and you'll be added as a guest as soon as you finish.
|
||||
<a href="<?php echo $html->url('/users/register'); ?>">Create account »</a></p>
|
||||
</div>
|
||||
<div style="width: 50%; float: right">
|
||||
<h2>Existing User</h2>
|
||||
<p>Login to add yourself to the guest list.</p>
|
||||
<form class="fxform" action="<?php echo $html->url('/users/login'); ?>" method="post">
|
||||
<div>
|
||||
<label class="label-large" for="UserEmail">Email Address:</label>
|
||||
<?php echo $html->input('User/email', array('size' => 20)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="UserPassword">Password:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 20)).
|
||||
$html->hidden('User/icode', array('value' => $icode));?>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<?php echo $html->submit('Login'); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<?php endif;
|
||||
if (isset($party) && isset($confirm_only)): ?>
|
||||
<p>You've been invited to attend <a href="<?php echo $html->url('/parties/view/'.$party['Party']['id']); ?>"><?php echo $party['Party']['name']; ?></a>.
|
||||
To join this party, <a href="<?php echo $html->url('/parties/invited/'.$icode.'/confirm');?>">click here</a>, or cancel this invitation by <a href="<?php echo $html->url('/parties/invited/cancel/');?>">clicking here</a>.</p>
|
||||
<?php endif; ?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php if (isset($party)): ?>
|
||||
<strong><?php echo $party['Party']['name']?></strong><br/><?php echo $party['Party']['vname']; ?><br/><a href="<?php echo $html->url('/parties/view/'.$party['Party']['id'])?>">View Party</a>
|
||||
<?php else: ?>
|
||||
function addParties() {
|
||||
<?php foreach ($parties as $party):
|
||||
if (!empty($party['Party']['lat']) && !empty($party['Party']['long']) && !$party['Party']['canceled']): ?>
|
||||
addParty(<?php echo $party['Party']['lat'];?>, <?php echo $party['Party']['long']?>, <?php echo $party['Party']['id']; ?>);
|
||||
<?php endif; endforeach;?>
|
||||
}
|
||||
//
|
||||
<?php endif; ?>
|
||||
@@ -1,140 +0,0 @@
|
||||
<?php
|
||||
if (isset($party)): ?>
|
||||
<h1><?php echo $party['Party']['name']; ?></h1>
|
||||
<br/>
|
||||
<?php if ($party['Party']['canceled']): ?>
|
||||
<div class="error">This party has been canceled</div>
|
||||
<?php endif; ?>
|
||||
Host: <a href="<?php echo $html->url('/users/view/'.$party['Party']['owner']).'">'.$host; ?></a><br/>
|
||||
<?php
|
||||
if (!empty($party['Party']['address']))
|
||||
echo 'Location: '.$party['Party']['address']."<br/>\n";
|
||||
|
||||
if (!empty($party['Party']['vname']))
|
||||
echo 'Venue: '.$party['Party']['vname']."<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";
|
||||
echo 'Duration: '.$party['Party']['duration'].' hour'.(($party['Party']['duration'] == 1) ? '' : 's')."\n<br/>";
|
||||
|
||||
if (!empty($party['Party']['website']) && preg_match("/^(http|https)\:\/\//i", $party['Party']['website']))
|
||||
echo 'Website: <a href="'.$party['Party']['website'].'" rel="nofollow">'.$party['Party']['website']."</a><br/>\n";
|
||||
|
||||
if (!empty($party['Party']['notes']))
|
||||
echo 'Notes: '.$party['Party']['notes']."<br/>\n";
|
||||
?>
|
||||
<br/>
|
||||
<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" class="small-map"></div>
|
||||
<h1>Who's coming</h1>
|
||||
<div>
|
||||
<?php if (!empty($guests)):
|
||||
$i = 0;
|
||||
$c = count($guests) - 1;
|
||||
foreach ($guests as $guest): ?>
|
||||
<a href="<?php echo $html->url('/users/view/'.$guest['users']['id']); ?>"><?php echo $guest['users']['name']; ?></a><?php echo ($i < $c) ? ", " : ""; ?>
|
||||
<?php $i++;
|
||||
endforeach;
|
||||
else:
|
||||
echo "No guests yet, be the first!";
|
||||
endif;
|
||||
|
||||
if (isset($_SESSION['User']['id']) && @$_SESSION['User']['id'] != $party['Party']['owner'] && ($party['Party']['inviteonly'] != 1 || $isguest && !$party['Party']['canceled'])):?>
|
||||
<br/><br/>
|
||||
<form action="<?php
|
||||
echo $html->url('/parties/'.((!$isguest) ? 'rsvp/' : 'unrsvp/').$party['Party']['id']); ?>" method="post">
|
||||
<?php if(!$isguest): ?>
|
||||
<button>Count me in!</button>
|
||||
<?php else: ?>
|
||||
<button>Remove me</button>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<? if ($party['Party']['inviteonly'] == 1 && (!$isguest && @$_SESSION['User']['id'] != $party['Party']['owner'] && !$party['Party']['canceled'])):?>
|
||||
<p>This party is invite only. You'll need an invite code from the host to join in.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (@$_SESSION['User']['id'] == $party['Party']['owner']):?>
|
||||
<h1>Party options</h1>
|
||||
<a href="<?php echo $html->url('/parties/edit/'.$party['Party']['id']);?>">Edit party</a>
|
||||
<?php if (!$party['Party']['canceled']): ?>| <a href="<?php echo $html->url('/parties/invite/'.$party['Party']['id']);?>">Invite a guest</a>
|
||||
<?php endif; echo (($party['Party']['canceled'] == 1) ? ' | <a href="'.$html->url('/parties/uncancel/'.$party['Party']['id']).'">
|
||||
Reactivate this party</a>' : '| <a href="'.$html->url('/parties/cancel/'.$party['Party']['id']).'" onclick="return confirm(\'Are you sure you want to cancel your party?\')"><span style="color: #bc1313">Cancel this party</span></a>'); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($flickr)): ?>
|
||||
<h1 id="photos">Photos <a title="Photo Feed" href="<?php echo $html->url('/feeds/photos/'.$party['Party']['id']); ?>"><img src="<?php echo $html->url('/img/feed16.png'); ?>" alt="Atom"/></a></h1>
|
||||
<div style="text-align: center">
|
||||
<?php if (empty($flickr)): ?>
|
||||
<p>No photos yet. Tag your flickr pictures with <?php echo FLICKR_TAG_PREFIX.$party['Party']['id']; ?> to display them here.</p>
|
||||
<?php else:
|
||||
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" ?>" title="<?php echo $pic['title']; ?>"/></a>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
<br/>
|
||||
</div>
|
||||
<?php endif;
|
||||
if (!empty($comments)): ?>
|
||||
<h1 id="comments">Comments <a title="Comment Feed" href="<?php echo $html->url('/feeds/comments/'.$party['Party']['id']); ?>"><img src="<?php echo $html->url('/img/feed16.png'); ?>" alt="RSS"/></a></h1>
|
||||
<?php $i = 0;
|
||||
foreach ($comments as $comment):
|
||||
if ($i % 2 == 0)
|
||||
$class = "";
|
||||
else
|
||||
$class = "comment-mod";
|
||||
$i++;?>
|
||||
<div id="c<?php echo $comment['comments']['cid'];?>" class="comment <?php echo $class;?>">
|
||||
<span class="comment-content"><?php echo $comment['comments']['text']; ?></span>
|
||||
<span class="comment-tag"><br/><br/>Posted by <a href="<?php echo $html->url('/users/view/'.$comment['users']['uid']); ?>">
|
||||
<?php echo $comment['users']['name']; ?></a> on <?php echo gmdate('Y-m-d h:ia', $comment['comments']['time'] + (@$_SESSION['User']['tz'] * 60 * 60)); ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<?php endforeach;
|
||||
endif;
|
||||
if (isset($_SESSION['User'])):
|
||||
if (($party['Party']['guestcomments'] && $isguest) || !$party['Party']['guestcomments'] || @$_SESSION['User']['id'] == $party['Party']['owner']): ?>
|
||||
<h1>Add a comment</h1>
|
||||
<form action="<?php echo $html->url('/comments/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'); ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;
|
||||
endif;
|
||||
endif; ?>
|
||||
|
||||
<?php if (isset($parties)):
|
||||
if (isset($prev))
|
||||
echo '<a href="'.$html->url('/parties/view/all/'.$prev).'">« Previous Page</a> ';
|
||||
if (isset($prev) && isset($next))
|
||||
echo ' | ';
|
||||
if (isset($next))
|
||||
echo '<a href="'.$html->url('/parties/view/all/'.$next).'">Next Page »</a>';
|
||||
$i = 0;
|
||||
foreach ($parties as $party):
|
||||
if ($party['Party']['canceled'] != 1): ?>
|
||||
<div>
|
||||
<h1><?php echo $party['Party']['name']; ?></h1>
|
||||
<p>
|
||||
<?php
|
||||
if (!empty($party['Party']['address']))
|
||||
echo 'Location: '.$party['Party']['address']."<br/>\n";
|
||||
|
||||
if (!empty($party['Party']['vname']))
|
||||
echo 'Venue: '.$party['Party']['vname']."<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";
|
||||
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['Party']['id']).'">View Party</a>';
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; endforeach;
|
||||
if (isset($prev))
|
||||
echo '<a href="'.$html->url('/parties/view/all/'.$prev).'">« Previous Page</a> ';
|
||||
if (isset($prev) && isset($next))
|
||||
echo ' | ';
|
||||
if (isset($next))
|
||||
echo '<a href="'.$html->url('/parties/view/all/'.$next).'">Next Page »</a>';
|
||||
endif;?>
|
||||
@@ -1,105 +0,0 @@
|
||||
<?php if ($error): ?>
|
||||
<div class="error">
|
||||
There was an error in your submission, please try again.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<form class="fxform" action="<?php echo $html->url('/users/edit'); ?>" method="post">
|
||||
<?php echo $html->hidden('User/id'); ?>
|
||||
<h1>Profile</h1>
|
||||
<div>
|
||||
<label for="UserName" class="label-large">Name:</label>
|
||||
<?php echo $html->input('User/name', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/name', 'You must enter a name.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserWebsite" class="label-large">Website:</label>
|
||||
<?php echo $html->input('User/website', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/website', 'Invalid URL.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="location" class="label-large">Location:</label>
|
||||
<?php echo $html->input('User/location', array('id' => 'location', 'size' => 40, 'onkeypress' => 'capture(event)')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserTz" class="label-large">Timezone:</label>
|
||||
<?php
|
||||
$tzs = array('-12' => 'GMT-12',
|
||||
'-11' => 'GMT-11',
|
||||
'-10' => 'GMT-10',
|
||||
'-9' => 'GMT-9',
|
||||
'-8' => 'GMT-8',
|
||||
'-7' => 'GMT-7',
|
||||
'-6' => 'GMT-6',
|
||||
'-5' => 'GMT-5',
|
||||
'-4' => 'GMT-4',
|
||||
'-3' => 'GMT-3',
|
||||
'-2' => 'GMT-2',
|
||||
'-1' => 'GMT-1',
|
||||
'0' => 'GMT+0',
|
||||
'1' => 'GMT+1',
|
||||
'2' => 'GMT+2',
|
||||
'3' => 'GMT+3',
|
||||
'4' => 'GMT+4',
|
||||
'5' => 'GMT+5',
|
||||
'6' => 'GMT+6',
|
||||
'7' => 'GMT+7',
|
||||
'8' => 'GMT+8',
|
||||
'9' => 'GMT+9',
|
||||
'10' => 'GMT+10',
|
||||
'11' => 'GMT+11',
|
||||
'12' => 'GMT+12',
|
||||
'13' => 'GMT+13');
|
||||
echo $html->selectTag('User/tz', $tzs, $utz, null, null, false);
|
||||
?>
|
||||
(current time is <?php echo gmdate("Y-m-d H:i:s"); ?> GMT)
|
||||
</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() {
|
||||
var loc = document.getElementById("location").value;
|
||||
geocode(loc);
|
||||
}
|
||||
|
||||
function capture(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
update();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<p id="map" class="small-map"></p>
|
||||
<?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; ?>
|
||||
<h1>Privacy</h1>
|
||||
<div>
|
||||
<label for="UserShowemail" class="label-large">Show email:</label>
|
||||
<?php echo $html->checkbox('User/showemail'); ?><br/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserShowloc" class="label-large">Show location:</label>
|
||||
<?php echo $html->checkbox('User/showloc'); ?><br/>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserShowmap" class="label-large">Show map:</label>
|
||||
<?php echo $html->checkbox('User/showmap'); ?><br/>
|
||||
</div>
|
||||
<h1>Password</h1>
|
||||
<div>
|
||||
<label for="UserPassword" class="label-large">New password:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 20, 'autocomplete' => 'off')); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label for="UserConfpassword" class="label-large">Confirm new password:</label>
|
||||
<?php echo $html->password('User/confpassword', array('size' => 20, 'autocomplete' => 'off')); ?>
|
||||
<?php echo $html->tagErrorMsg('User/confpassword', 'The supplied passwords do not match!')?>
|
||||
</div>
|
||||
<?php echo $html->submit('Update'); ?>
|
||||
</form>
|
||||
@@ -1,61 +0,0 @@
|
||||
<h1>My Profile</h1>
|
||||
<br/>
|
||||
<h2>Parties I'm attending</h2>
|
||||
<p>
|
||||
<?php
|
||||
$num_parties = count($parties);
|
||||
if ($num_parties == 0)
|
||||
echo 'None yet. <a href="'.$html->url('/parties/view/all').'">Find one!</a>';
|
||||
|
||||
else {
|
||||
$c = $num_parties - 1;
|
||||
$i = 0;
|
||||
foreach ($parties as $party) {
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<h2>Parties I'm hosting</h2>
|
||||
<p>
|
||||
<?php
|
||||
$num_parties = count($hparties);
|
||||
if (empty($hparties))
|
||||
echo 'None yet. <a href="'.$html->url('/parties/add').'">Create one!</a>';
|
||||
|
||||
else {
|
||||
$c = $num_parties - 1;
|
||||
$i = 0;
|
||||
foreach ($hparties as $party) {
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h2>Parties I've been invited to</h2>
|
||||
<p>
|
||||
<?php
|
||||
$num_parties = count($iparties);
|
||||
if (empty($iparties))
|
||||
echo 'None yet.';
|
||||
|
||||
else {
|
||||
$c = $num_parties - 1;
|
||||
$i = 0;
|
||||
foreach ($iparties as $party) {
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<h2>Account Options</h2>
|
||||
<p>
|
||||
<a href="<?php echo $html->url('/users/edit'); ?>">Edit my account</a>
|
||||
<br/>
|
||||
<a href="<?php echo $html->url('/users/logout'); ?>">Logout</a>
|
||||
</p>
|
||||
@@ -1,17 +0,0 @@
|
||||
<h1>Login</h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/users/login'); ?>" method="post">
|
||||
<div>
|
||||
<label class="label-large" for="UserEmail">Email Address:</label>
|
||||
<?php echo $html->input('User/email', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="UserPassword">Password:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 40)); ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo $html->submit('Login'); ?>
|
||||
</div>
|
||||
<p>
|
||||
<a href="<?php echo $html->url('/users/register'); ?>">Create an account</a> | <a href="<?php echo $html->url('/users/recover/password'); ?>">Forgot your password?</a>
|
||||
</p>
|
||||
</form>
|
||||
@@ -1,26 +0,0 @@
|
||||
<h1><?php echo $atitle; ?></h1>
|
||||
<form class="fxform" action="<?php
|
||||
if (isset($reset))
|
||||
echo $html->url('/users/recover/reset/'.$code);
|
||||
else
|
||||
echo $html->url('/users/recover/'.$url); ?>" method="post">
|
||||
<?php if (isset($error)): ?>
|
||||
<div class="error">
|
||||
<?php echo $error; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div>
|
||||
<?php if (!$hideInput): ?>
|
||||
<label class="label-large" for="UserEmail">Email address:</label>
|
||||
<?php echo $html->input('User/email'); ?>
|
||||
<?php endif;
|
||||
if (isset($reset)): ?>
|
||||
<label class="label-large" for="UserPassword">New password:</label>
|
||||
<?php echo $html->password('User/password'); ?>
|
||||
<br/>
|
||||
<label class="label-large" for="UserConfirm">Confirm password:</label>
|
||||
<?php echo $html->password('User/confirm'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php echo $html->submit('Submit'); ?>
|
||||
</form>
|
||||
@@ -1,110 +0,0 @@
|
||||
<h1>Register</h1>
|
||||
<form class="fxform" action="<?php echo $html->url('/users/register'); ?>" method="post">
|
||||
<p>Your e-mail address is used as your username to login. You'll also receive a confirmation e-mail to
|
||||
this address. In order for your account to be activated successfully, you must specify a valid e-mail address.</p>
|
||||
<div>
|
||||
<label class="label-large" for="UserEmail">Email address<span class="required">*</span>:</label>
|
||||
<?php echo $html->input('User/email', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/email', 'The email address you entered is invalid or has already been registered.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="UserConfemail">Confirm Email address<span class="required">*</span>:</label>
|
||||
<?php echo $html->input('User/confemail', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/confemail', 'The email addresses you entered do not match.')?>
|
||||
</div>
|
||||
<p>How do you want to be known to visitors of <?php echo APP_NAME; ?>?</p>
|
||||
<div>
|
||||
<label class="label-large" for="UserName">Name<span class="required">*</span>:</label>
|
||||
<?php echo $html->input('User/name', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/name', 'You must enter a name.')?>
|
||||
</div>
|
||||
<p>If you choose to enter it, your location will be shown on your profile. This
|
||||
field is optional.
|
||||
<div>
|
||||
<label class="label-large" for="UserLocation">Location:</label>
|
||||
<?php echo $html->input('User/location', array('id' => 'location', 'size' => 40, 'onkeypress' => 'capture(event)', 'onblur' => 'update()')); ?>
|
||||
<div id="locerr" class="info" style="display: none">Did you mean: <a id="locerrlink" onclick="geocode_suggest()" href="#"></a>? <a href="#" onclick="shide()"><span style="font-size: x-small">(close)</span></a></div>
|
||||
</div>
|
||||
<p>If you have a website, enter the URL here. (including the http:// ) Your website will be
|
||||
shown to site visitors on your author profile page. This field is optional; if you don't
|
||||
have a website or don't want it linked to from <?php echo APP_NAME; ?>, leave this box blank.</p>
|
||||
<div>
|
||||
<label class="label-large" for="UserWebsite">Website:</label>
|
||||
<?php echo $html->input('User/website', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/website', 'Invalid URL.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="UserTz">Timezone<span class="required">*</span>:</label>
|
||||
<?php
|
||||
$tzs = array('-12' => 'GMT-12',
|
||||
'-11' => 'GMT-11',
|
||||
'-10' => 'GMT-10',
|
||||
'-9' => 'GMT-9',
|
||||
'-8' => 'GMT-8',
|
||||
'-7' => 'GMT-7',
|
||||
'-6' => 'GMT-6',
|
||||
'-5' => 'GMT-5',
|
||||
'-4' => 'GMT-4',
|
||||
'-3' => 'GMT-3',
|
||||
'-2' => 'GMT-2',
|
||||
'-1' => 'GMT-1',
|
||||
'0' => 'GMT+0',
|
||||
'1' => 'GMT+1',
|
||||
'2' => 'GMT+2',
|
||||
'3' => 'GMT+3',
|
||||
'4' => 'GMT+4',
|
||||
'5' => 'GMT+5',
|
||||
'6' => 'GMT+6',
|
||||
'7' => 'GMT+7',
|
||||
'8' => 'GMT+8',
|
||||
'9' => 'GMT+9',
|
||||
'10' => 'GMT+10',
|
||||
'11' => 'GMT+11',
|
||||
'12' => 'GMT+12',
|
||||
'13' => 'GMT+13');
|
||||
echo $html->selectTag('User/tz', $tzs, $utz, null, null, false);
|
||||
?>
|
||||
(this page was loaded at <?php echo gmdate("Y-m-d H:i:s"); ?> GMT)
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="password">Password<span class="required">*</span>:</label>
|
||||
<?php echo $html->password('User/password', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/password', 'You must enter a password.')?>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label-large" for="confpassword">Confirm password<span class="required">*</span>:</label>
|
||||
<?php echo $html->password('User/confpass', array('size' => 40)); ?>
|
||||
<?php echo $html->tagErrorMsg('User/confpass', 'The passwords you supplied do not match.')?>
|
||||
</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() {
|
||||
var loc = document.getElementById("location").value;
|
||||
geocode(loc);
|
||||
}
|
||||
|
||||
function capture(event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
update();
|
||||
}
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<p><span class="required">*</span> Required field</p>
|
||||
<p>Drag the map or the marker to specify your location. Set the zoom by using the '+' or '-' buttons on the left.</p>
|
||||
<p id="map" class="med-map-r"></p>
|
||||
<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/geocoded', array('id' => 'geocoded', 'value' => 0));
|
||||
echo $html->hidden('User/icode', array('value' => @$icode)); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php echo $html->submit('Register'); ?>
|
||||
</form>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
if (!empty($user['User']['name']))
|
||||
echo "<h1>".$user['User']['name']."</h1><br/>";
|
||||
|
||||
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']) && preg_match("/^(http|https)\:\/\//i", $user['User']['website']))
|
||||
echo 'Website: <a href="'.$user['User']['website'].'" rel="nofollow">'.$user['User']['website'].'</a><br/>';
|
||||
|
||||
if (!empty($parties)) {
|
||||
echo "Attending: ";
|
||||
$c = count($parties) - 1;
|
||||
$i = 0;
|
||||
|
||||
foreach ($parties as $party) {
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '<br/>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($hparties)) {
|
||||
echo "Hosting: ";
|
||||
$c = count($hparties) - 1;
|
||||
$i = 0;
|
||||
|
||||
foreach ($hparties as $party) {
|
||||
echo '<a href="'.$html->url('/parties/view/'.$party['parties']['id']).'">'.$party['parties']['name'].'</a>';
|
||||
echo ($i < $c) ? ', ' : '<br/>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if(isset($map) && $user['User']['showmap'] == 1): ?>
|
||||
<br/>
|
||||
<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,101 +0,0 @@
|
||||
<?php
|
||||
/* SVN FILE: $Id: css.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
|
||||
*/
|
||||
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
}
|
||||
/**
|
||||
* Enter description here...
|
||||
*/
|
||||
require(LIBS . 'folder.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,230 +0,0 @@
|
||||
.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;
|
||||
}
|
||||
|
||||
.att { color: #d4d4d4; }
|
||||
|
||||
#f-left {
|
||||
width: 75%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#f-right {
|
||||
width: 25%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.cbox {
|
||||
text-align: center;
|
||||
border: 1px solid #808080;
|
||||
background: #eee;
|
||||
padding: 5px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.cbox a { outline: none; }
|
||||
|
||||
.ctxt {
|
||||
font-size: 200%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cfeed {
|
||||
position: relative;
|
||||
bottom: 15px;
|
||||
float: right;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.ifeed {
|
||||
position: relative;
|
||||
bottom: 15px;
|
||||
float: right;
|
||||
height: 16px;
|
||||
width: 34px;
|
||||
}
|
||||
|
||||
.required { color: red; font-weight: bold;}
|
||||
|
||||
.fxform div { margin: 1em 0; }
|
||||
|
||||
.label-large, .label-medium, .label-small {
|
||||
border-bottom: 1px dashed #eee;
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.label-large { width: 14em; }
|
||||
|
||||
.large-map { width: 700px; height: 500px; margin: 0 auto; }
|
||||
.med-map-r { width: 500px; height: 300px; margin: 0 auto; }
|
||||
.med-map-r div { margin: 0; }
|
||||
.small-map { width: 400px; height: 200px;}
|
||||
.small-map div { margin: 0; }
|
||||
|
||||
.load { width: 700px; margin: 0 auto; padding-top: 5px; }
|
||||
|
||||
.comment {
|
||||
border: 1px solid #ccc;
|
||||
border-top: 0;
|
||||
padding: 10px 5px 0 5px;
|
||||
}
|
||||
.comment-mod { background: #ecedf3; }
|
||||
|
||||
.comment-content { font-size: 125%; padding-bottom: 50px; }
|
||||
.comment-tag { font-size: 75%; }
|
||||
|
||||
h1 { border-bottom: 1px solid #ccc;
|
||||
margin-bottom: 0;}
|
||||
|
||||
#footer { padding: 30px 0 20px 0; }
|
||||
|
||||
img { border: none }
|
||||
|
||||
body {
|
||||
background: #fff url("../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: 740px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#mozilla-com a {
|
||||
float: right;
|
||||
display: block;
|
||||
outline: none;
|
||||
text-indent: -5000em;
|
||||
width: 110px;
|
||||
height: 25px;
|
||||
text-decoration: none;
|
||||
background: url("../img/mozilla-org.png") no-repeat;
|
||||
}
|
||||
|
||||
#key-menu {
|
||||
background: #B2C1C8 url("../img/header-bottom.gif") 0 100% no-repeat;
|
||||
padding: 0 0 10px 0;
|
||||
overflow: auto;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
* html #key-menu {
|
||||
overflow: visible;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
#key-menu ul, #key-menu li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#key-menu ul {
|
||||
padding: 14px 12px 0 12px;
|
||||
background: url("../img/header-top.gif") 0 0 no-repeat;
|
||||
}
|
||||
|
||||
#key-menu li {
|
||||
float: left;
|
||||
background: url("../img/tabs.gif") 100% -50px;
|
||||
padding-right: 5px;
|
||||
margin-right: 2px;
|
||||
border-bottom: 1px solid #849CA4;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
#key-menu li a, #key-menu li span {
|
||||
display: block;
|
||||
float: left;
|
||||
padding: 3px 15px 2px 20px;
|
||||
background: url("../img/tabs.gif") 0 -50px;
|
||||
color: #5A7CBA;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#key-menu li:hover a {
|
||||
background-position: 0 -100px;
|
||||
}
|
||||
|
||||
#key-menu li:hover {
|
||||
background-position: 100% -100px;
|
||||
}
|
||||
|
||||
#key-menu li.current {
|
||||
background: url("../img/tabs.gif") 100% 0;
|
||||
border-bottom-color: white;
|
||||
}
|
||||
|
||||
#key-menu li.current a, #key-menu li.current span {
|
||||
background: url("../img/tabs.gif") 0 0;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#key-menu a:focus { outline: none; }
|
||||
|
||||
#header {
|
||||
clear: both;
|
||||
padding-top: 40px;
|
||||
position: relative;
|
||||
} * html #header { padding-top: 20px; }
|
||||
|
||||
#header h1 {
|
||||
height: 46px;
|
||||
margin: 0;
|
||||
font-size: 2px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -4px;
|
||||
border: none;
|
||||
z-index: 5000;
|
||||
}
|
||||
|
||||
#user {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 9px;
|
||||
margin-left: 200px;
|
||||
font-family: tahoma, arial, sans-serif;
|
||||
font-size: 95%;
|
||||
}
|
||||
|
||||
.skipLink {
|
||||
position: absolute;
|
||||
left: -1200px;
|
||||
width: 990px;
|
||||
}
|
||||
|
||||
#map {
|
||||
border: 1px solid #555;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 365 B |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 825 B |