Example #1
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER);
$USER->recountOlastaMail();
$USER->commit();
$smarty = new MMSmarty();
$smarty->assign("pagetitle", "Mail");
$do = isset($_GET['do']) ? Security::escape($_GET['do']) : 'inbox';
$my_id = $USER->getId();
$smarty->assign("my_id", $my_id);
$motiomeraMail_Folders = new MotiomeraMail_Folders($my_id);
$folders = $motiomeraMail_Folders->getFolders();
$smarty->assign("folders", $folders);
$folder_id = "0";
$myself = Medlem::loadById($USER->getId());
$my_contacts = $myself->getUsersThatHasMeAsContact(0);
$smarty->assign("my_contacts", $my_contacts);
if ($do == 'inbox') {
    $action = "inbox";
    if (isset($_GET['folder_id'])) {
        $folder_id = Security::escape($_GET['folder_id']);
    }
    $box_mails = MotiomeraMail::listMailInbox($USER->getId(), $folder_id);
    $smarty->assign("box_mails", $box_mails);
    $smarty->assign("is_inbox", true);
    $smarty->assign("to_include", "mail_box.tpl");
} else {
    if ($do == 'outbox') {
        $action = "outbox";
        $smarty->assign("is_inbox", false);
Example #2
0
 public function delete()
 {
     global $USER;
     if (Security::authorized(ADMIN) or $USER->getId() == $this->getId()) {
         Adressbok::removeAllMedlemKontakter($this);
         Anslagstavla::deleteAllMemberPosts($this);
         $this->deleteAllProfilDataVal();
         //ta bort alla mail
         MotiomeraMail::removeAllMemberMail($this);
         MotiomeraMail_Folders::deleteMemberFolders($this);
         //mal tabellen verkar oanvänd, nedanstående rad ej testad
         //MalManager::removeAllMedlemMal($this);
         Help::removeAllMedlemAvfardade($this);
         Quiz::removeAllMemberQuizresults($this);
         Fotoalbum::removeAllMedlemFolders($this);
         //lag inte i burk atm, nedanstående rad ej testad
         //Lag::removeMedlemFromAllLag($this);
         /* remove member from foretagsnycklar */
         $foretag = Foretag::loadByMedlem($this);
         if (isset($foretag)) {
             $foretag->gaUr($this->getId());
         }
         /* inga matchande klasser för mindre tabeller */
         global $db;
         $tables = array('mm_pokal', 'mm_medalj', 'mm_help_medlem_noshow');
         foreach ($tables as $table) {
             $sql = 'DELETE FROM ' . $table . ' WHERE medlem_id = "' . $this->getId() . '"';
             $db->nonquery($sql);
         }
         //mm_order, mm_prenumeration töms ej avsiktligen
         //ta bort medlemmen ur grupper (och grupper den skapat)
         $agrupp = Grupp::listByMedlem($this);
         foreach ($agrupp as $grupp) {
             if ($grupp->getSkapareId() == $this->getId()) {
                 $grupp->delete();
             }
             /* else
                $grupp->leaveGrupp($this); */
         }
         Grupp::flushMemberFromGroups($this);
         Stracka::deleteUserStrackor($this);
         $asteg = Steg::listByMedlem($this);
         foreach ($asteg as $steg) {
             $steg->delete();
         }
         FeedItem::deleteAllMedlemFeedItems($this);
         parent::delete();
     }
 }
Example #3
0
<?php

include $_SERVER["DOCUMENT_ROOT"] . "/php/init.php";
Security::demand(USER);
$my_id = Security::escape($_POST['my_id']);
$action = Security::escape($_POST['todo']);
$folder_name = Security::escape($_POST['folder_name']);
if ($action == 'create') {
    $motiomeraMail_Folders = new MotiomeraMail_Folders($my_id);
    $folder_created = $motiomeraMail_Folders->createFolder(utf8_encode($folder_name));
    if ($folder_created) {
        echo '1';
        exit;
    }
    echo '0';
    exit;
}