Exemplo n.º 1
0
 function afterAction(&$base)
 {
     if (!Roll::isFormInvalid()) {
         $base->setInfoText($this->method);
     }
     LocationHistory::saveInfoText();
     if (Roll::isFormInvalid()) {
         LocationHistory::rollBack(1);
     } else {
         LocationHistory::resetPost();
         CacheManager::resetCache(0, TRUE);
         //performReset
         if (isset($base->nextAction)) {
             LocationHistory::rollBack($base->nextAction);
         } elseif (isset($base->rollBackNum)) {
             LocationHistory::rollBack($base->rollBackNum);
         } else {
             if ($this->method == "delete") {
                 $ctrl =& new AppController(LocationHistory::getBack(2));
                 // ha showdetails-rol mentunk a delete-re, akkor a showdetails elotti oldalra terunk vissza:
                 if ($ctrl->list == $this->list && $ctrl->method == "showdetails" && $ctrl->rollid == $this->rollid) {
                     LocationHistory::rollBack(3);
                 }
             }
             LocationHistory::rollBack(2);
         }
     }
 }
Exemplo n.º 2
0
 function create($fromInstall = FALSE)
 {
     global $gorumuser;
     $_S =& new AppSettings();
     $_EC = EComm::createObject();
     if (empty($this->cid)) {
         return Roll::setFormInvalid("selectCategoryNecessary");
     }
     hasAdminRights($isAdm);
     if (!$_S->showSubmitAd() && !$isAdm) {
         handleError("Permission denied");
     }
     $this->activateVariableFields();
     LocationHistory::resetPost();
     $this->initClassVars();
     LocationHistory::savePost($this);
     if (!$this->checkAgainstEarlySubmission() || !$this->checkCharacterLimit() || $this->checkMandatoryFileUpload() || !$this->checkAndSetExpirationDays() || !$_EC->checkConsumptionOfAction($purchaseItem, $consumption, $this)) {
         return;
     }
     if (!$isAdm || !isset($this->status)) {
         $this->status = $this->getImmediateAppear($consumption);
         // ha viszont isAdm, akkor a status benne van a formban
     }
     if ($this->status) {
         if ($this->expiration) {
             $this->expirationTime = Date::add($this->expiration, Date_Day);
         }
     }
     $this->setDefaultsOfFieldsThatDontAppearInForm();
     if (!isset($this->ownerId)) {
         $this->ownerId = $gorumuser->id;
     }
     parent::create();
     if (!Roll::isFormInvalid()) {
         G::load($c, $this->cid, "appcategory");
         if ($this->status) {
             $c->increaseDirectItemNum();
         }
         if ($fromInstall) {
             return;
         } elseif (!$purchaseItem) {
             Roll::addInfoText("adScheduled");
         }
         $this->storeAttachment();
         // hogyy hogy nem cName es ownerName itt 0-ra beallitva, ami bezavarhat a getEmailParams-ban:
         unset($this->cName);
         unset($this->ownerName);
         $ownerEmail = $this->getEmailParams($params, TRUE);
         if (!$isAdm) {
             $_S =& new AppSettings();
             G::load($n, Notification_adCreated, "notification");
             if ($n->active) {
                 $n->send($_S->adminEmail, $params);
             }
             G::load($n, Notification_adCreatedOwner, "notification");
             if ($n->active) {
                 $n->send($ownerEmail, $params);
             }
         }
         if ($purchaseItem) {
             $purchaseItem->save($this);
         } elseif (!$isAdm && $consumption) {
             executeQuery("UPDATE @user SET credits=credits-{$consumption} WHERE id=#id#", $gorumuser->id);
         }
         $this->sendNotificationsToSubscribedUsers($params);
         if (empty($this->nextAction)) {
             $this->nextAction = $this->getLinkCtrl();
         }
         CacheManager::resetCache($this->cid);
     }
 }
Exemplo n.º 3
0
 function generForm($elementName = "")
 {
     global $gorumview;
     /* if( !Roll::isPreviousFormSubmitInvalid() )  */
     LocationHistory::resetPost();
     $formPresentationClassName = G::getSetting($this->getTypeInfo(TRUE), "formPresentationClassName");
     $temp =& new $formPresentationClassName($this);
     return $temp->gener($gorumview->addElement($elementName));
 }
Exemplo n.º 4
0
 function create()
 {
     global $gorumuser, $gorumauthlevel;
     $this->activateVariableFields();
     LocationHistory::resetPost();
     $this->initClassVars();
     LocationHistory::savePost($this);
     if (!$this->validRegistration()) {
         return FALSE;
     }
     unset($this->isAdm);
     $this->active = FALSE;
     // Majd az elso bejelentkezes utan lesz true
     $plainPassword = $this->generatePassword();
     $this->setDefaultsOfFieldsThatDontAppearInForm();
     if ($gorumauthlevel == Loginlib_GuestLevel) {
         // don't create a new user, only updating the current
         // nameless user with the newly registered username and
         // password:
         $this->id = $gorumuser->id;
         modify($this);
         if (Roll::isFormInvalid()) {
             return;
         }
     } else {
         if ($gorumauthlevel == Loginlib_BasicLevel || $gorumauthlevel == Loginlib_LowLevel) {
             generateRandomId($randomId);
             $this->id = $randomId;
             create($this);
             if (Roll::isFormInvalid()) {
                 return;
             }
         }
     }
     $this->storeAttachment();
     load($this);
     // hogy a notification minden mezot tartalmazhasson
     $this->sendPassword($plainPassword, Notification_initialPassword, "youWillGetAEmailCheckEmail");
     return $plainPassword;
 }