* */ /** * Class ReopenMail : Contains all the specific functions to reopen a mail * * @author Claire Figueras * @license GPL * @package Maarch LetterBox 2.0 * @version 2.0 */ class ReopenMail extends dbquery { /** * Redefinition of the LetterBox object constructor */ function __construct() { parent::__construct(); } /** * Checks the res_id * * @param string $mode add or up */ public function reopen_mail_check() { if(empty($_REQUEST['id'])) { $_SESSION['error'] = _ID.' '._IS_EMPTY; } else { $_SESSION['m_admin']['reopen_mail']['ID'] = $this->wash($_REQUEST['id'], "num", _ID." "); } } /** * Update databse * */ public function update_db() { // add ou modify users in the database $this->reopen_mail_check(); if(!empty($_SESSION['error'])) { header("location: ".$_SESSION['config']['businessappurl']."index.php?page=reopen_mail&id=".$_SESSION['m_admin']['reopen_mail']['ID']."&admin=reopen_mail"); exit(); } else { require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_security.php"); $sec = new security(); $ind_coll = $sec->get_ind_collection('letterbox_coll'); $table = $_SESSION['collections'][$ind_coll]['table']; $this->connect(); $this->query("select res_id from ".$table." where res_id = ".$_SESSION['m_admin']['reopen_mail']['ID']); if($this->nb_result() == 0) { $_SESSION['error'] = _NUM_GED." "._UNKNOWN; header("location: ".$_SESSION['config']['businessappurl']."index.php?page=reopen_mail&id=".$_SESSION['m_admin']['reopen_mail']['ID']."&admin=reopen_mail"); exit(); } $this->query("update ".$table." set status = 'COU' where res_id = ".$_SESSION['m_admin']['reopen_mail']['ID'].""); if($_SESSION['history']['resup'] == true ) { require_once("core".DIRECTORY_SEPARATOR."class".DIRECTORY_SEPARATOR."class_history.php"); $hist = new history(); $hist->add($table, $_SESSION['m_admin']['reopen_mail']['ID'],"UP",_REOPEN_THIS_MAIL." : ".$_SESSION['m_admin']['reopen_mail']['ID'], $_SESSION['config']['databasetype'], 'apps'); } $_SESSION['error'] = _REOPEN_THIS_MAIL." : ".$_SESSION['m_admin']['reopen_mail']['ID']; unset($_SESSION['m_admin']); header("location: ".$_SESSION['config']['businessappurl']."index.php?page=admin"); exit(); } } /** * Form to reopen a mail * */ public function formreopenmail() { ?>




" >


()