Esempio n. 1
0
<?php

if (empty($attributes['id'])) {
    _error("ENoLanguageGiven", "No language given");
} else {
    if ($oLanguageManager->removeLanguagesByID($attributes['id'])) {
        _message("MLanguagesRemoved", "Languages removed successfully");
    } else {
        _warning("WLanguageNotRemoved", "Lanugage was not removed");
    }
}
_xfa($myself . "admin.showLanguages");
Esempio n. 2
0
<?php

if (!empty($attributes['fCode']) && isset($attributes['fName'])) {
    if (!$oPropertyManager->setProperty($attributes['fCode'], array('code' => $attributes['fCode'], 'name' => $attributes['fName']))) {
        _warning("WPropertyNotSaved", "Something happened when storing property, probably property with such code already exists");
    } else {
        _message("MPropertySaved", "Property was sucessfully saved");
    }
} else {
    _error("EWrongFormSubmitted", "Wrong form submitted, or else...");
}
_xfa($myself . "admin.showProperties");
Esempio n. 3
0
        if (($x = $stanza->exists('x', NS_MUC . '#user')) !== false) {
            if (($status = $x->exists('status', null, array('code' => '110'))) !== false) {
                $item = $x->exists('item');
                _info("xmlns #user exists with x " . $x->ns . " status " . $status->attrs['code'] . ", affiliation:" . $item->attrs['affiliation'] . ", role:" . $item->attrs['role']);
            } else {
                _info("xmlns #user have no x child element");
            }
        } else {
            _warning("=======> odd case 1");
        }
    } else {
        if (strtolower($from->bare) == strtolower($room_full_jid->bare)) {
            if (($x = $stanza->exists('x', NS_MUC . '#user')) !== false) {
                $item = $x->exists('item');
                echo "presence stanza of type " . ($stanza->type ? $stanza->type : "available") . " received from " . $from->resource . ", affiliation:" . $item->attrs['affiliation'] . ", role:" . $item->attrs['role'] . PHP_EOL;
            } else {
                _warning("=======> odd case 2");
            }
        } else {
            _warning("=======> odd case 3");
        }
    }
});
$client->add_cb('on_disconnect', function () {
    _info("got on_disconnect cb");
});
//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";
<?php

if (isset($attributes['fCode']) && isset($attributes['fXCode']) && isset($attributes['fName']) && isset($attributes['fPos'])) {
    if (strlen($attributes['fCode']) > 0) {
        if (isset($attributes['entryid'])) {
            if (!$oPropertyManager->setDictionaryEntryByID($attributes['entryid'], array('code' => $attributes['fCode'], 'xcode' => $attributes['fXCode'], 'name' => $attributes['fName'], 'pos' => $attributes['fPos']))) {
                _warning("WPropertyDictionaryEntryNotStored", "Something happened while saving property dictionary entry to DB, probably another entry exists with same code or no entry with such ID (already) exists");
            } else {
                _message("MPropertyDictionaryEntryStored", "Property dictionary entry successfully stored");
            }
        } elseif (isset($attributes['propertycode'])) {
            if (!$oPropertyManager->addDictionaryEntry($attributes['propertycode'], array('code' => $attributes['fCode'], 'xcode' => $attributes['fXCode'], 'name' => $attributes['fName'], 'pos' => $attributes['fPos']))) {
                _warning("WPropertyDictionaryEntryNotAdded", "Something happened while adding property dictionary entry to DB, probably entry with such code already exists");
            } else {
                _message("MPropertyDictionaryEntryAdded", "Property dictionary entry successfully added");
            }
        } else {
            _error("ENoPropertyOrEntryFound", "No property or dictionary entry given");
        }
    } else {
        _warning("WPropertyDictionaryEntryCodeCannotBeEmpty", "Property dictionary entry code cannot be empty");
    }
} else {
    _error("EWrongEntryFormSubmitted", "Invalid property dictionary form submitted");
}
_xfa($myself . "admin.showPropertyDictionary&code=" . $attributes['propertycode']);
// add necessary event callbacks here
//
$client->add_cb('on_auth_success', function () {
    global $client;
    _info("got on_auth_success cb, jid " . $client->full_jid->to_string());
    // create node
    //$client->xeps['0060']->create_node('pubsub.localhost', 'dummy_node');
    // subscribe
    $client->xeps['0060']->subscribe('pubsub.localhost', 'dummy_node');
});
$client->add_cb('on_auth_failure', function ($reason) {
    global $client;
    $client->send_end_stream();
    _info("got on_auth_failure cb with reason {$reason}");
});
$client->add_cb('on_headline_message', function ($stanza) {
    global $client;
    if ($event = $stanza->exists('event', NS_PUBSUB . '#event')) {
        _info("got pubsub event");
    } else {
        _warning("unknown headline message rcvd");
    }
});
$client->add_cb('on_disconnect', function () {
    _info("got on_disconnect cb");
});
//
// finally start configured xmpp stream
//
$client->start();
echo "done\n";
Esempio n. 6
0
                        _warning("WArticleNotStored", "Something happened while storing article");
                    }
                } else {
                    _warning("WArticleCannotBeConverted", "Article cannot be converted to " . $l->getEncoding());
                }
            }
            $tmpFormFieldName = 'title_' . $l->getID();
            if (isset($attributes[$tmpFormFieldName])) {
                $strTitle = html_entity_decode($attributes[$tmpFormFieldName], ENT_COMPAT, $l->getEncoding());
                if ($strTitle !== false) {
                    if (!$ogArticleManager->pushTitle($attributes['fuseactionid'], $l->getID(), $attributes['token'], $strTitle)) {
                        _warning("WArticleTitleNotStored", "Something happened while storing article title");
                    }
                } else {
                    _warning("WArticleTitleCannotBeConverted", "Article title cannot be converted to " . $l->getEncoding());
                }
            }
        }
        $tmpFormFieldName = 'description';
        if (isset($attributes[$tmpFormFieldName])) {
            if (!$ogArticleManager->pushDescription($attributes['fuseactionid'], $attributes['token'], $attributes[$tmpFormFieldName])) {
                _warning("WArticleDescriptionNotStored", "Something happened while storing article description");
            }
        }
    } else {
        _error("ENoTokenGiven", "No token is given");
    }
} else {
    _error("ENoFuseactionGiven", "No page is given");
}
echo "<script>window.opener.location.reload(); window.close();</script>";
Esempio n. 7
0
 public function handle_other($event, $args)
 {
     $stanza = $args[0];
     $stanza = new XMPPStanza($stanza);
     $ev = 'on_' . $stanza->name . '_stanza';
     if ($this->ev->exists($ev)) {
         return $this->ev->emit($ev, array($stanza));
     } else {
         _warning("event '" . $event . "' catched in handle_other with stanza name " . $stanza->name);
     }
 }
Esempio n. 8
0
<?php

if (!empty($attributes['id'])) {
    if (is_numeric($attributes['id'])) {
        if ($oSecurityManager->checkGroupByID($attributes['id'])) {
            if ($oSecurityManager->removeGroupsByID($attributes['id'])) {
                _message("MGroupRemoved", "Group removed");
            }
        } else {
            _warning("WNoSuchGroup", "No such group found");
        }
    } elseif (is_array($attributes['id'])) {
        if ($oSecurityManager->removeGroupsByID($attributes['id'])) {
            _message("MGroupsRemoved", "Groups removed");
        }
    } else {
        _error("EInvalidGroupID", "Invalid group ID");
    }
} else {
    _error("ENoGroupGiven", "No security group is given to delete");
}
_xfa($myself . "admin.showGroups");
Esempio n. 9
0
<?php

if (empty($attributes['id']) && empty($attributes['key'])) {
    _error("ENoFuseactionGiven", "No page or action is given");
} else {
    $tmpFuseaction = false;
    if (isset($attributes['id']) && intval($attributes['id']) > 0) {
        $tmpFuseaction = $oFuseManager->getFuseactionByID(intval($attributes['id']));
    } elseif (isset($attributes['key'])) {
        $tmpFuseaction = $oFuseManager->getFuseaction($attributes['key']);
    } else {
        _error("ENoValidFuseactionGiven", "No valid page or action is given");
    }
    if (!$tmpFuseaction) {
        _error("ENoFuseactionFound", "No such page or action found in DB");
    } else {
        $tmpFuseaction->setResponsibility($attributes['fResponsibility']);
        if ($oFuseManager->setFuseaction($tmpFuseaction->getName(), $tmpFuseaction)) {
            _message("MFuseactionStored", "Page/action responsibilities stored successfully");
        } else {
            _warning("WFuseactionNotStored", "Page/action responsibilities not saved");
        }
    }
}
if (!_gotxfa()) {
    _xfa($myself . "admin.showFuseaction&id={$attributes['id']}");
}
Esempio n. 10
0
<?php

$tmpUser = false;
if (!empty($attributes['fLogin'])) {
    if ($tmpUser = $oUserManager->getUser($attributes['fLogin'])) {
        _log("Changing password for user " . $tmpUser->getLogin());
        $strNewUserPassword = $oUserManager->resetPassword($tmpUser->getLogin());
    } else {
        _warning("WNoSuchUser", "No user with such login exists");
    }
} else {
    _error("EWrongFormSubmitted", "Wrong form submitted");
}
_xfa($myself . "home.showPasswordRecoverConfirmation");
Esempio n. 11
0
<?php

if (!empty($attributes['id'])) {
    if (is_numeric($attributes['id'])) {
        if (!($tmpUser = $oUserManager->getUserByID($attributes['id']))) {
            _error("ENoSuchUser", "There is no user with ID = " . $attributes['id']);
        }
    } else {
        _error("EInvalidUserID", "Invalid user ID");
    }
} else {
    $attributes['id'] = 0;
    $tmpUser = new User();
}
if (isset($attributes['id']) && isset($attributes['fLogin']) && isset($attributes['fPwd']) && isset($attributes['fPwd2']) && isset($attributes['fEmail'])) {
    $tmpUser->setID($attributes['id']);
    if (!$tmpUser->setLogin($attributes['fLogin'])) {
        _warning("WInvalidLogin", "Login is invalid or empty");
    }
    if (!$tmpUser->setEmail($attributes['fEmail'])) {
        _warning("WInvalidEmail", "Email address is invalid or empty");
    }
    $tmpUser->setFirstName($attributes['fFirstName']);
    $tmpUser->setMiddleName($attributes['fMiddleName']);
    $tmpUser->setLastName($attributes['fLastName']);
    $tmpUser->setBirthDate($attributes['fBirthDate']);
}
_assign("arrCountries", $oPropertyManager->getDictionary("fCountry"));
_assign("tmpUser", $tmpUser);
_display("admin/dspUserForm.tpl");
Esempio n. 12
0
<?php

if (empty($attributes['token']) && !empty($attributes['article'])) {
    $attributes['token'] = $attributes['article'];
} else {
    if (empty($attributes['article']) && !empty($attributes['token'])) {
        $attributes['article'] = $attributes['token'];
    }
}
if (!empty($attributes['token']) && !empty($attributes['fName']) && !empty($attributes['fComment'])) {
    if (strlen($_SESSION['SecretUserString']) > 0) {
        if (!empty($attributes['fHString'])) {
            if ($_SESSION['SecretUserString'] != $attributes['fHString']) {
                _warning("WCaptchaStringNotMatch", "Secret user string not match");
            } else {
                if ($ogArticleManager->storeComment($attributes['token'], $attributes['fName'], $attributes['fComment'])) {
                    _message("MCommentAdded", "Your comment is added");
                    _xfa($myself . "home.showArticleComments&article=" . $attributes['token']);
                } else {
                    _warning("WErrorSavingComment", "Error happened while saving comment, please try again");
                }
            }
        } else {
            _warning("WCaptchaStringEmpty", "Secret user string is empty");
        }
    } else {
        _warning("WCaptchaStringUnknown", "Secret user string is unknown");
    }
} else {
    _warning("WEnterComment", "Please enter your name and your comment");
}
Esempio n. 13
0
                $arrUserGroups = $oSecurityManager->pullUserGroups($userlogged->getID());
                $userXFA = $fusebox['defaultFuseaction'];
                if ($arrUserGroups) {
                    $userlogged->setGroups($arrUserGroups);
                    if (!_gotxfa()) {
                        //find valid user's home page
                        foreach ($arrUserGroups as $tmpGroup) {
                            if ($tmpGroup->getHomePage() && $oFuseManager->getFuseaction($tmpGroup->getHomePage())) {
                                $userXFA = $tmpGroup->getHomePage();
                            }
                        }
                    }
                }
                _xfa($myself . $userXFA);
                $oUser = $userlogged;
                $log .= "'... success!";
            } else {
                _warning("WIncorrectPassword", "Password provided for login {$attributes['fLogin']} is incorrect");
                $log .= "'... failed.";
            }
            _log($log);
        } else {
            _warning("WNoSuchUser", "There is no user {$attributes['fLogin']} registered with system");
        }
    } else {
        _warning("WEmptyLoginCredentials", "Cannot log in with empty login or password");
    }
    if (!_gotErrors() && !_gotWarnings()) {
        _log("After successful login user became " . $oUser->getFullName() . " (" . $oUser->getLogin() . ", " . $oUser->getID() . ")");
    }
}
/*
 * storing data
 */
if (!_gotErrors() && !_gotWarnings()) {
    if (empty($attributes['id'])) {
        $params = array("title" => $attributes['title'], "file" => $oFile->getFileName(), "mime" => $oFile->getFileMimeType());
        if (!$ogArticleAttachmentManager->addAttachment($attributes['token'], $params)) {
            $oFileManager->deleteFile($oFile);
            _warning("WAttachmentNotStored", "Something happened while storing attachment");
        }
    } else {
        $arrAttachment = $ogArticleAttachmentManager->getAttachment(intval($attributes['id']));
        $params = array("title" => $attributes['title']);
        if ($oFile) {
            $params['file'] = $oFile->getFileName();
            $params['mime'] = $oFile->getFileMimeType();
        }
        if ($ogArticleAttachmentManager->updateAttachment(intval($attributes['id']), $params)) {
            if ($oFile) {
                @unlink($fusebox['pathArticleAttachment'] . $arrAttachment['file']);
            }
        } else {
            if ($oFile) {
                $oFileManager->deleteFile($oFile);
            }
            _warning("WAttachmentNotStored", "Something happened while storing attachment");
        }
    }
} else {
    $arrAttachment = $attributes;
}
Esempio n. 15
0
<?php

$result = false;
if (isset($attributes['fuseactionid']) && is_numeric($attributes['fuseactionid'])) {
    $result = true;
    foreach ($attributes as $k => $a) {
        if (strpos($k, "sq_") !== false) {
            $arrID = explode("_", $k);
            if (!$oSecurityManager->pushGroupAccessByID($arrID[1], $a)) {
                $result = false;
            }
        }
    }
} else {
    _error("ENoFuseactionGiven", "No fuseaction given");
}
if (!$result) {
    _warning("WExceptionSavingSecurity", "Something happened while permissions update performed");
} else {
    _message("MSecurityUpdated", "Permissions updated");
}
_xfa($myself . "admin.showFuseactionSecurityTokens&id=" . $attributes['fuseactionid']);
Esempio n. 16
0
<?php

if (!$oUser->isDefaultUser()) {
    $tmpUser = $oUser;
} else {
    $tmpUser = new User();
    if (isset($attributes['fLogin']) && isset($attributes['fPwd']) && isset($attributes['fPwd2']) && isset($attributes['fEmail'])) {
        if (!$tmpUser->setLogin($attributes['fLogin'])) {
            _warning("WInvalidLogin", "Login is invalid or empty");
        }
        if (!$tmpUser->setEmail($attributes['fEmail'])) {
            _warning("WInvalidEmail", "Email address is invalid or empty");
        }
        $tmpUser->setFirstName($attributes['fFirstName']);
        $tmpUser->setMiddleName($attributes['fMiddleName']);
        $tmpUser->setLastName($attributes['fLastName']);
        $tmpUser->setBirthDate($attributes['fBirthDate']);
    }
}
$oCaptcha = new Captcha($fusebox['pathAssets'] . "fonts");
if (!$oCaptcha->initialize()) {
    _warning("WCaptchaNotInitialized", "Captcha not initialized");
}
_assign("arrCountries", $oPropertyManager->getDictionary("fCountry"));
_assign("tmpUser", $tmpUser);
_display("home/dspRegistrationForm.tpl");
Esempio n. 17
0
<?php

_warning("WAccessDenied", "Access to this page is denied. Please (re-)login or contact administrator.");
_display("home/dspAccessDenied.tpl");
 public function closed($event, $args)
 {
     _warning("uncatched {$event}");
 }
Esempio n. 19
0
<?php

if (!isset($attributes['login']) || strlen($attributes['login']) == 0) {
    _warning("WEmptyLogin", $oContentManager->getTitle("WEmptyLogin", "Please enter your Login"));
} else {
    if (!($UserID = $oUserManager->checkUser($attributes['login']))) {
        _warning("WUserNotFound", $oContentManager->getTitle("WUserNotFound", "User with specified Login is not exists"));
    } else {
        //set recover signature and send reset link to user
        _log("Sending reset password link to user");
        //for php versions < 4.2
        list($usec, $sec) = explode(' ', microtime());
        srand((double) $sec + (double) $usec * 100000);
        $recoverSignature = md5(rand(1111111, 9999999));
        $recUser = $oUserManager->getUser($attributes['login']);
        $sql = "UPDATE " . $fusebox['tableUsers'] . " SET recoversignature = '" . addslashes($recoverSignature) . "' WHERE id = " . intval($recUser->getID());
        $oDB->query($sql);
        $strSubject = $ogMailTemplatesManager->getTitle("ResetPassword");
        $strBody = $ogMailTemplatesManager->getContentReplaced("ResetPassword", array("{LINK}" => $fusebox['urlBase'] . $myself . "home.showResetPasswordForm&signature=" . $recoverSignature . "&login="******"{LOGIN}" => $recUser->getLogin()));
        $oPHPMailer = new PHPMailer();
        $oPHPMailer->IsHTML(true);
        $oPHPMailer->From = $oSettingsManager->getValue("MailerEmail", 'root@localhost', "STRING", "Mailer E-mail");
        $oPHPMailer->FromName = $oSettingsManager->getValue("MailerName", 'Mail Robot', "STRING", "Mailer Name");
        $oPHPMailer->CharSet = $oLanguage->getEncoding();
        $oPHPMailer->AddAddress($recUser->getEmail());
        $oPHPMailer->Subject = $strSubject;
        $oPHPMailer->Body = $strBody;
        $oPHPMailer->Send();
        unset($oPHPMailer);
        _message("MResetLinkSent", $oContentManager->getTitle("MResetLinkSent", "Reset password link was sent to your email address"));
    }
Esempio n. 20
0
}
if (isset($attributes['fCode'])) {
    if (!$tmpoGroup->setCode($attributes['fCode'])) {
        _warning("WEmptyGroupCode", "Group code cannot be empty and may contain only letters and numbers, no spaces");
    }
}
if (isset($attributes['fName'])) {
    $tmpoGroup->setName($attributes['fName']);
}
if (isset($attributes['fDescription'])) {
    $tmpoGroup->setDescription($attributes['fDescription']);
}
if (isset($attributes['fHomePage'])) {
    $tmpoGroup->setHomePage($attributes['fHomePage']);
    if (strlen($attributes['fHomePage']) && !$oFuseManager->getFuseaction($attributes['fHomePage'])) {
        _warning("WInvalidHomePage", "Specified home page is not found");
    }
}
if (!_gotWarnings() && !_gotErrors()) {
    if (!empty($attributes['id'])) {
        if (!$oSecurityManager->setGroupByID($attributes['id'], $tmpoGroup)) {
            _error("ECannotSaveGroup", "Cannot save group \"" . $tmpoGroup->getName() . "\"");
        } else {
            _message("MGroupSaved", "Group saved successfully");
        }
    } else {
        if (!$oSecurityManager->addGroup($tmpoGroup)) {
            _error("ECannotAddGroup", "Cannot add group \"" . $tmpoGroup->getName() . "\"");
        } else {
            _message("MGroupAdded", "Group added successfully");
        }
Esempio n. 21
0
<?php

if ($ogArticleManager->muteCommentsByID($attributes['commentid'])) {
    _message("MCommentsMuted", "Article comment(s) muted");
} else {
    _warning("WCommentsNotMuted", "Something happened while muting comments");
}
Esempio n. 22
0
function loadActionClass($classname)
{
    global $application;
    if (!class_exists($classname)) {
        $mm = $application->getInstance('Modules_Manager');
        if (!key_exists($classname, $mm->actionList)) {
            _warning("{$classname} not found");
            $res = null;
            return $res;
        }
        // define the file name for given action
        $actionFile = $mm->actionList[$classname];
        // load the file
        $mm->includeFile($actionFile);
    }
}
Esempio n. 23
0
<?php

$galleryPath = $fusebox['pathGalleries'] . $attributes['gallery'] . "/";
$thumbsPath = $galleryPath . $fusebox['folderThumbs'] . "/";
if (!empty($attributes['gallery']) && !empty($attributes['image'])) {
    if ($strImageFileName = $ogGalleryManager->getImageFileName($attributes['gallery'], $attributes['image'])) {
        if ($ogGalleryManager->deleteImage($attributes['gallery'], $attributes['image'])) {
            if (file_exists($galleryPath . $strImageFileName)) {
                if (!unlink($galleryPath . $strImageFileName)) {
                    _message("MGalleryImageFileRemained", "Gallery image file remained on disk");
                }
            }
            if (file_exists($thumbsPath . $strImageFileName)) {
                if (!unlink($thumbsPath . $strImageFileName)) {
                    _message("MGalleryThumbFileRemained", "Gallery image thumbnail file remained on disk");
                }
            }
            $ogGalleryManager->setGalleryUpdatedDate($attributes['gallery']);
            _message("MGalleryImageDeleted", "Gallery image deleted");
        } else {
            _warning("WGalleryImageNotDeleted", "Gallery image not deleted");
        }
    } else {
        _warning("WGalleryImageNotFound", "Gallery image not found");
    }
} else {
    _error("EGalleryImageNotGiven", "Gallery image not given to delete");
}
<?php

if (empty($attributes['id'])) {
    _error("ENoFuseactionGiven", "No page or action is given");
} else {
    $tmpFuseaction = false;
    if (isset($attributes['id']) && intval($attributes['id']) > 0) {
        $tmpFuseaction = $oFuseManager->getFuseactionByID(intval($attributes['id']));
    } else {
        _error("ENoValidFuseactionGiven", "No valid page or action is given");
    }
    if (!$tmpFuseaction) {
        _error("ENoFuseactionFound", "No such page or action found in DB");
    } else {
        if (!$oContentManager->deleteFuseactionTokens($tmpFuseaction->getID())) {
            _warning("WFuseactionNotCleared", "Cannot clear page content. DB error.");
        } else {
            _message("MFuseactionCleared", "Page content was removed successfully");
            _xfa($myself . "admin.showContentPages");
        }
    }
}
if (!_gotxfa()) {
}
Esempio n. 25
0
                        _warning("WContentNotStored", "Something happened while storing content");
                    }
                } else {
                    _warning("WContentCannotBeConverted", "Content cannot be converted to " . $l->getEncoding());
                }
            }
            $tmpFormFieldName = 'title_' . $l->getID();
            if (isset($attributes[$tmpFormFieldName])) {
                $strTitle = html_entity_decode($attributes[$tmpFormFieldName], ENT_COMPAT, $l->getEncoding());
                if ($strTitle !== false) {
                    if (!$oContentManager->pushTitle($attributes['fuseactionid'], $l->getID(), $attributes['token'], $strTitle)) {
                        _warning("WTitleNotStored", "Something happened while storing title");
                    }
                } else {
                    _warning("WTitleCannotBeConverted", "Title cannot be converted to " . $l->getEncoding());
                }
            }
        }
        $tmpFormFieldName = 'description';
        if (isset($attributes[$tmpFormFieldName])) {
            if (!$oContentManager->pushDescription($attributes['fuseactionid'], $attributes['token'], $attributes[$tmpFormFieldName])) {
                _warning("WDescriptionNotStored", "Something happened while storing description");
            }
        }
    } else {
        _error("ENoTokenGiven", "No token is given");
    }
} else {
    _error("ENoFuseactionGiven", "No page is given");
}
_xfa($myself . "admin.showFuseactionContentTokens&id=" . $attributes['fuseactionid']);
Esempio n. 26
0
<?php

if (!isset($attributes['name']) || strlen($attributes['name']) == 0) {
    _warning("WEmptyName", $oContentManager->getTitle("WEmptyName", "Please enter your name"));
} else {
    if (!isset($attributes['email']) || strlen($attributes['email']) == 0) {
        _warning("WEmptyEmail", $oContentManager->getTitle("WEmptyEmail", "Please enter your email"));
    } else {
        if (preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/", $attributes['email']) == 0) {
            _warning("WInvalidEmail", $oContentManager->getTitle("WInvalidEmail", "Please enter valid email"));
        } else {
            if ($_SESSION['SecretUserString'] != $attributes['captcha']) {
                _warning("WInvalidCaptcha", $oContentManager->getTitle("WInvalidCaptcha", "Security string is not correct"));
            } else {
                $replaceFrom = array("{TEXT}");
                $replaceTo = array($attributes['text']);
                $subject = str_replace($replaceFrom, $replaceTo, $ogMailTemplatesManager->getTitle("ContactUs", "Message from site visitor"));
                $body = str_replace($replaceFrom, $replaceTo, $ogMailTemplatesManager->getContent("ContactUs", "{TEXT}"));
                $oPHPMailer = new PHPMailer();
                $oPHPMailer->IsHTML(true);
                $oPHPMailer->From = stripslashes($attributes['email']);
                $oPHPMailer->FromName = stripslashes($attributes['name']);
                $oPHPMailer->CharSet = $oLanguage->getEncoding();
                $oPHPMailer->AddAddress($oSettingsManager->getValue("ContactUsEmail", 'postmaster@' . $_SERVER['HTTP_HOST'], "STRING", "Contact Us email address"));
                $oPHPMailer->Subject = stripslashes($subject);
                $oPHPMailer->Body = stripslashes($body);
                $oPHPMailer->Send();
                unset($oPHPMailer);
                _message("MContactUsMessageSent", "Message sent");
            }
        }
Esempio n. 27
0
<?php

if (isset($attributes['fuseactionid']) && is_numeric($attributes['fuseactionid'])) {
    if (!empty($attributes['token'])) {
        $arrLanguages = $oLanguageManager->getLanguages();
        foreach ($arrLanguages as $l) {
            $tmpFormFieldName = 'content_' . $l->getID();
            if (isset($attributes[$tmpFormFieldName])) {
                $strContent = html_entity_decode($attributes[$tmpFormFieldName], ENT_COMPAT, $l->getEncoding());
                if ($strContent !== false) {
                    if (!$oSEOContentManager->pushContent($attributes['fuseactionid'], $l->getID(), $attributes['token'], $strContent)) {
                        _warning("WSEOContentNotStored", "Something happened while storing SEO content");
                    }
                } else {
                    _warning("WSEOContentCannotBeConverted", "SEO content cannot be converted to " . $l->getEncoding());
                }
            }
        }
    } else {
        _error("ENoSEOTokenGiven", "No SEO token is given");
    }
} else {
    _error("ENoFuseactionGiven", "No page is given");
}
_xfa($myself . "admin.showFuseactionSEOTokens&id=" . $attributes['fuseactionid']);
Esempio n. 28
0
$thumbsPath = $galleryPath . $fusebox['folderThumbs'] . "/";
if (!empty($attributes['gallery'])) {
    if ($ogGalleryManager->checkGallery($attributes['gallery'])) {
        $arrGalleryImages = $ogGalleryManager->getImages($attributes['gallery']);
        foreach ($arrGalleryImages as $gi) {
            if ($strImageFileName = $ogGalleryManager->getImageFileName($attributes['gallery'], $gi['token'])) {
                if (file_exists($galleryPath . $strImageFileName)) {
                    @unlink($galleryPath . $strImageFileName);
                }
                if (file_exists($thumbsPath . $strImageFileName)) {
                    @unlink($thumbsPath . $strImageFileName);
                }
            }
        }
        if (file_exists($thumbsPath)) {
            @rmdir($thumbsPath);
        }
        if (file_exists($galleryPath)) {
            @rmdir($galleryPath);
        }
        if ($ogGalleryManager->deleteGallery($attributes['gallery'])) {
            _message("MGalleryRemoved", "Gallery deleted");
        } else {
            _warning("WCannotRemoveGallery", "Cannot remove gallery");
        }
    } else {
        _error("EGalleryNotExists", "Gallery not exists");
    }
} else {
    _error("ENoGalleryGiven", "No gallery given");
}
 public function on_read_ready($fd)
 {
     //_debug("on read ready called");
     $raw = @fread($fd, $this->recv_chunk_size);
     $bytes = strlen($raw);
     if ($bytes === 0) {
         $meta = stream_get_meta_data($fd);
         if ($meta['eof'] === TRUE) {
             _warning("socket eof, disconnecting");
             JAXLLoop::unwatch($fd, array('read' => true));
             $this->disconnect();
             return;
         }
     }
     $this->recv_bytes += $bytes;
     $total = $this->ibuffer . $raw;
     $this->ibuffer = "";
     _debug("read " . $bytes . "/" . $this->recv_bytes . " of data");
     if ($bytes > 0) {
         _debug($raw);
     }
     // callback
     if ($this->recv_cb) {
         call_user_func($this->recv_cb, $raw);
     }
 }
Esempio n. 30
0
 /**
  * Loads the file of the specified event handler, creates an object
  * and returns a reference to it.
  *
  * @return object action
  */
 function &getActionObject($actionName)
 {
     global $application;
     //  returns a reference to the class, if it has been loaded
     if (class_exists($actionName)) {
         return $application->getInstance($actionName);
     }
     //  check, if the class is registered in the list
     if (!key_exists($actionName, $this->actionList)) {
         _warning("{$actionName} not found");
         $res = null;
         return $res;
     }
     // define the file name for given action
     $actionFile = $this->actionList[$actionName];
     // load the file
     $this->includeFile($actionFile);
     // create an object copy and return a reference to the object
     return $application->getInstance($actionName);
 }