mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 16:32:20 +00:00
Merge branch 'master' of https://github.com/FH-Complete/FHC-Core
Also the data of the message sender are not taken anymore via the Person_model, but via the MessageToken_model, to avoid that the login will be prompted
This commit is contained in:
Regular → Executable
+34
-5
@@ -12,17 +12,17 @@ class MessageToken_model extends CI_Model
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
|
||||
// Loads config file message
|
||||
$this->config->load('message');
|
||||
|
||||
|
||||
// Load return message helper
|
||||
$this->load->helper('message');
|
||||
|
||||
|
||||
// Loads the database object
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a received message identified by token
|
||||
*/
|
||||
@@ -45,7 +45,7 @@ class MessageToken_model extends CI_Model
|
||||
) s ON (r.message_id = s.message_id AND r.person_id = s.person_id)
|
||||
WHERE r.token = ?
|
||||
LIMIT 1';
|
||||
|
||||
|
||||
$result = $this->db->query($sql, array(MSG_STATUS_DELETED, $token));
|
||||
|
||||
// If no errors occurred
|
||||
@@ -139,5 +139,34 @@ class MessageToken_model extends CI_Model
|
||||
{
|
||||
return error($this->db->error());
|
||||
}
|
||||
|
||||
return success($result->result());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data of the message sender
|
||||
*/
|
||||
public function getSenderData($person_id)
|
||||
{
|
||||
$sql = 'SELECT p.vorname,
|
||||
p.nachname,
|
||||
p.anrede,
|
||||
p.titelpost,
|
||||
p.titelpre,
|
||||
p.vornamen
|
||||
FROM public.tbl_person p
|
||||
WHERE p.person_id = ?';
|
||||
|
||||
$result = $this->db->query($sql, array($person_id));
|
||||
|
||||
// If no errors occurred
|
||||
if ($result)
|
||||
{
|
||||
return success($result->result());
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($this->db->error());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user