Example #1
0
 public function BasePictureDirectory()
 {
     $gs =& GlobalSingleton::GetInstance();
     $dir = $gs->PictureDirectory();
     if (trim($dir) == "") {
         throw new Exception("Picture Directory not found");
     }
     return $dir;
 }
Example #2
0
 function &_BrokenRules()
 {
     $brs = new Broken_Rules();
     $gs =& GlobalSingleton::GetInstance();
     $capThisPersonIsAlreadyAssociatedToThisMovie = $gs->GetText($locale, 'capThisPersonIsAlreadyAssociatedToThisMovie');
     $capActorMustHaveCharacterName = $gs->GetText($locale, 'capActorMustHaveCharacterName');
     $capNoPerson = $gs->GetText($locale, 'capNoPerson');
     $capNoMovie = $gs->GetText($locale, 'capNoMovie');
     if ($this->IsNew()) {
         /*TODO:BUG: Single quotes need to be escaped */
         $m2p = new MovieToPerson("movieID = " . $this->MovieID() . " AND " . "personID = " . $this->PersonID() . " AND " . "relationship = '" . $this->Relationship() . "' AND " . "((relationship <> 's') OR (relationship = 's' AND characterName = '" . $this->CharacterName() . "'))");
         if (!$m2p->IsEmpty()) {
             $brs->Add("DUPLICATE_ASSOCIATION", $capThisPersonIsAlreadyAssociatedToThisMovie);
         }
     }
     $brs->Assert('NO_ACTOR', $this->PersonID() == "");
     $brs->Assert('NO_MOVIE', $this->MovieID() == "");
     $brs->Assert('NO_CHAR_NAME', $capActorMustHaveCharacterName, $this->Relationship() == 's' && $this->CharacterName() == "");
     return $brs;
 }
Example #3
0
<?php

// vim: set et ts=4 sw=4 fdm=marker:
/*
    Copyright (C) 2008 Jesse Hogan <*****@*****.**>
    All rights reserverd
*/
/*TODO: Redirect to google doesn't seem to work */
# session_start();
try {
    ob_start();
    require_once "conf/style.php";
    require_once "conf/kvp.php";
    require_once "ExceptionLogs.php";
    require_once "GlobalSingleton.php";
    $gs =& GlobalSingleton::GetInstance();
    $gs->PictureDirectory($PIC_DIR);
    /* The above lines need to be run first before an exception can
       be properly handled */
    define('REPORT_TYPE_SPAM', 0);
    define('REPORT_TYPE_ABUSE', 1);
    define('RESOLVED_STATE_UNRESOLVED', 0);
    define('RESOLVED_STATE_DISABLED', 1);
    define('RESOLVED_STATE_IGNORED', 2);
    define('LOGIN_USER_NOT_FOUND', 0);
    define('LOGIN_AUTH', 1);
    define('LOGIN_ACCOUNT_DISABLED', 2);
    define('LOGIN_FAILED_AUTH', 3);
    if (get_magic_quotes_gpc) {
        foreach ($_GET as $key => $val) {
            $_GET[$key] = stripslashes($val);
Example #4
0
 function &_BrokenRules()
 {
     $brs = new Broken_Rules();
     $gs =& GlobalSingleton::GetInstance();
     if ($this->IsNew()) {
         $per = new Person("firstName = '" . $this->FirstName() . "' AND " . "lastName = '" . $this->LastName() . "'");
     } else {
         $per = new Person("id != " . $this->ID() . " AND firstName = '" . $this->FirstName() . "' AND " . "lastName = '" . $this->LastName() . "'");
     }
     if (!$per->IsEmpty()) {
         $capThisPersonAleadyExistsInTheDatabase = $gs->GetText($locale, 'capThisPersonAleadyExistsInTheDatabase');
         $brs->Add("DUPLICATE_PERSON", $capThisPersonAleadyExistsInTheDatabase);
     }
     return $brs;
 }
Example #5
0
 function &_BrokenRules()
 {
     $brs = new Broken_Rules();
     $gs =& GlobalSingleton::GetInstance();
     $capMissingURL = $gs->GetText($locale, 'capMissingURL');
     $capInvalidType = $gs->GetText($locale, 'capInvalidType');
     $capSourceMustBeCap = $gs->GetText($locale, 'capSourceMustBeCaption');
     $capAuthorRequired = $gs->GetText($locale, 'capAuthorRequired');
     $capSchemaRequired = $gs->GetText($locale, 'capHTTP(s)SchemaRequired');
     if ($this->Type() == 'r' && $this->Author() == "") {
         $brs->Add("AUTHOR_REQUIRED", $capAuthorRequired);
     }
     $brs->Assert("NO_URL", $capMissingURL, strlen($this->URL()) == 0);
     $brs->Assert("INVALID_TYPE", $capInvalidType, !in_array($this->Type(), $this->_validTypes));
     $brs->Assert("SOURCE_NOT_CAP", $capSourceMustBeCap, strpos($this->Source(), 'cap') !== 0);
     $brs->Assert("HTTP_SCHEMA_REQ", $capSchemaRequired, substr(strtolower($this->Schema()), 0, 4) != "http");
     return $brs;
 }
Example #6
0
 function ToString()
 {
     $gs =& GlobalSingleton::GetInstance();
     $user =& $this->User();
     if ($user != null) {
         $username = $user->Username();
     }
     $sesID = $this->SessionID();
     $msg = $this->Msg();
     $id = $this->InstanceID();
     if ($id > 0) {
         $directObject =& $gs->NewObject($this->ClassID(), $this->InstanceID());
         $directObject = $directObject->ToString();
     }
     $obj = $this->Object();
     if ($user == null) {
         $subject = "[{$sesID}]";
     } else {
         $subject = $username . " [{$sesID}]";
     }
     $verb = $msg;
     $prepPhrase = "for {$obj}";
     $ret .= str_pad($subject, '15') . ' ';
     $ret .= str_pad($verb, 15) . ' ';
     if (isset($directObject)) {
         $ret .= str_pad($directObject, 15) . ' ';
     }
     if ($obj != '') {
         $ret .= $prepPhrase;
     }
     return $ret;
 }
Example #7
0
 function __construct($id = null)
 {
     $this->Business_Base($id);
     $this->_gs =& GlobalSingleton::GetInstance();
 }
Example #8
0
 function &Locale()
 {
     $gs =& GlobalSingleton::GetInstance();
     $locales =& $gs->GetLocales();
     $locales =& $locales->GetBy('LocaleID', $this->LocaleID());
     if ($locales->Count() > 0) {
         return $locales->current();
     } else {
         return null;
     }
 }