ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailOptions Class Reference

Class UserMail this class handles user mails. More...

+ Collaboration diagram for ilMailOptions:

Public Member Functions

 ilMailOptions ($a_user_id)
 Constructor setup an mail object.
 createMailOptionsEntry ()
 create entry in table_mail_options for a new user this method should only be called from createUser() public
 getOptions ()
 get options of user and set variables $signature and $linebreak this method shouldn't bew called from outside use getSignature() and getLinebreak() private
 updateOptions ($a_signature, $a_linebreak, $a_incoming_type, $a_cronjob_notification)
 update user options
 getLinebreak ()
 get linebreak of user public
 getSignature ()
 get signature of user public
 getIncomingType ()
 setCronjobNotification ()
 getCronjobNotification ()

Data Fields

 $ilias
 $LOCAL = 0
 $EMAIL = 1
 $BOTH = 2
 $linebreak
 $signature
 $incoming_type
 $cronjob_notification

Detailed Description

Class UserMail this class handles user mails.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilMailOptions.php 23143 2010-03-09 12:15:33Z smeyer

Definition at line 37 of file class.ilMailOptions.php.

Member Function Documentation

ilMailOptions::createMailOptionsEntry ( )

create entry in table_mail_options for a new user this method should only be called from createUser() public

Returns
boolean

Definition at line 87 of file class.ilMailOptions.php.

References $ilDB, and IL_MAIL_BOTH.

{
global $ilDB;
/* Get setting for incoming mails */
if (!($incomingMail = $this->ilias->getSetting("mail_incoming_mail")))
{
/* No setting found -> set it to "local and forwarding" [2] */
$incomingMail = IL_MAIL_BOTH;
}
$statement = $ilDB->manipulateF('
INSERT INTO '.$this->table_mail_options.'
( user_id,
linebreak,
signature,
incoming_type,
cronjob_notification
)
VALUES(%s, %s, %s, %s, %s)',
array('integer', 'integer', 'text', 'integer', 'integer'),
array($this->user_id, DEFAULT_LINEBREAK, NULL, $incomingMail, '0'));
return true;
}
ilMailOptions::getCronjobNotification ( )

Definition at line 215 of file class.ilMailOptions.php.

References $cronjob_notification.

ilMailOptions::getIncomingType ( )

Definition at line 206 of file class.ilMailOptions.php.

References $incoming_type.

Referenced by ilMailOptionsGUI\setMailOptionsValuesByDB(), and ilPersonalSettingsGUI\setMailOptionsValuesByDB().

{
}

+ Here is the caller graph for this function:

ilMailOptions::getLinebreak ( )

get linebreak of user public

Returns
array mails

Definition at line 191 of file class.ilMailOptions.php.

References $linebreak.

{
}
ilMailOptions::getOptions ( )

get options of user and set variables $signature and $linebreak this method shouldn't bew called from outside use getSignature() and getLinebreak() private

Returns
boolean

Definition at line 120 of file class.ilMailOptions.php.

References $ilDB, $LOCAL, $res, $row, ilObjUser\_lookupEmail(), and DB_FETCHMODE_OBJECT.

Referenced by ilMailOptions().

{
global $ilDB;
$res = $ilDB->queryf('
SELECT * FROM '.$this->table_mail_options.'
WHERE user_id = %s',
array('integer'), array($this->user_id));
$this->cronjob_notification = stripslashes($row->cronjob_notification);
$this->signature = stripslashes($row->signature);
$this->linebreak = stripslashes($row->linebreak);
$this->incoming_type = $row->incoming_type;
if(!strlen(ilObjUser::_lookupEmail($this->user_id)))
{
$this->incoming_type = $this->LOCAL;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailOptions::getSignature ( )

get signature of user public

Returns
array mails

Definition at line 201 of file class.ilMailOptions.php.

References $signature.

{
}
ilMailOptions::ilMailOptions (   $a_user_id)

Constructor setup an mail object.

Parameters
intuser_id public

Definition at line 68 of file class.ilMailOptions.php.

References $ilias, and getOptions().

{
global $ilias;
define("DEFAULT_LINEBREAK",60);
$this->ilias =& $ilias;
$this->table_mail_options = 'mail_options';
$this->user_id = $a_user_id;
$this->getOptions();
}

+ Here is the call graph for this function:

ilMailOptions::setCronjobNotification ( )

Definition at line 211 of file class.ilMailOptions.php.

References $cronjob_notification.

ilMailOptions::updateOptions (   $a_signature,
  $a_linebreak,
  $a_incoming_type,
  $a_cronjob_notification 
)

update user options

Parameters
stringSignature
intlinebreak
intincoming_type
intcronjob_notification
Returns
boolean

Definition at line 152 of file class.ilMailOptions.php.

References $data, $ilDB, $ilias, and $query.

{
global $ilDB, $ilias;
$data = array();
$data_types = array();
$query = 'UPDATE '.$this->table_mail_options.'
SET signature = %s,
linebreak = %s, ';
array_push($data_types, 'text', 'integer');
array_push($data, $a_signature, $a_linebreak);
if ($ilias->getSetting('mail_notification'))
{
$query .= 'cronjob_notification = %s, ';
array_push($data_types, 'integer');
array_push($data, $a_cronjob_notification);
}
$query .='incoming_type = %s WHERE user_id = %s';
array_push($data, $a_incoming_type, $this->user_id);
array_push($data_types, 'integer', 'integer');
$statement = $ilDB->manipulateF($query, $data_types, $data);
$this->cronjob_notification = $a_cronjob_notification;
$this->signature = $a_signature;
$this->linebreak = $a_linebreak;
$this->incoming_type = $a_incoming_type;
return true;
}

Field Documentation

ilMailOptions::$BOTH = 2

Definition at line 44 of file class.ilMailOptions.php.

ilMailOptions::$cronjob_notification

Definition at line 60 of file class.ilMailOptions.php.

Referenced by getCronjobNotification(), and setCronjobNotification().

ilMailOptions::$EMAIL = 1

Definition at line 43 of file class.ilMailOptions.php.

ilMailOptions::$ilias

Definition at line 39 of file class.ilMailOptions.php.

Referenced by ilMailOptions(), and updateOptions().

ilMailOptions::$incoming_type

Definition at line 59 of file class.ilMailOptions.php.

Referenced by getIncomingType().

ilMailOptions::$linebreak

Definition at line 51 of file class.ilMailOptions.php.

Referenced by getLinebreak().

ilMailOptions::$LOCAL = 0

Definition at line 42 of file class.ilMailOptions.php.

Referenced by getOptions().

ilMailOptions::$signature

Definition at line 58 of file class.ilMailOptions.php.

Referenced by getSignature().


The documentation for this class was generated from the following file: