mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
- Added Redirect controller to redirect from the link present in the email to
the page for viewing the message
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Redirect extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// The second parameter is used to avoiding name collisions in the config array
|
||||
$this->config->load('fhcomplete');
|
||||
}
|
||||
|
||||
public function redirectByToken($token)
|
||||
{
|
||||
if (isset($token))
|
||||
{
|
||||
redirect($this->config->item('addons_aufnahme_url') . '?token=' . $token);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class ViewMessage extends CI_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('MessageLib');
|
||||
}
|
||||
|
||||
public function toHTML($token)
|
||||
{
|
||||
$msg = $this->messagelib->getMessageByToken($token);
|
||||
if ($msg->error)
|
||||
{
|
||||
show_error($msg->retval);
|
||||
}
|
||||
|
||||
if (is_array($msg->retval) && count($msg->retval) > 0)
|
||||
{
|
||||
$data = array (
|
||||
'message' => $msg->retval[0]
|
||||
);
|
||||
|
||||
$this->load->view('system/messageHTML.php', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,23 +105,6 @@ class Message extends APIv1_Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getRedirectByToken()
|
||||
{
|
||||
$token = $this->get('token');
|
||||
|
||||
if (isset($token))
|
||||
{
|
||||
redirect(CIS_ROOT);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -141,24 +141,6 @@ class Messages extends VileSci_Controller
|
||||
redirect('/system/Messages/view/' . $msg->retval . '/' . $receiver_id);
|
||||
}
|
||||
|
||||
public function toHTML($token)
|
||||
{
|
||||
$msg = $this->messagelib->getMessageByToken($token);
|
||||
if ($msg->error)
|
||||
{
|
||||
show_error($msg->retval);
|
||||
}
|
||||
|
||||
if (is_array($msg->retval) && count($msg->retval) > 0)
|
||||
{
|
||||
$data = array (
|
||||
'message' => $msg->retval[0]
|
||||
);
|
||||
|
||||
$this->load->view('system/messageHTML.php', $data);
|
||||
}
|
||||
}
|
||||
|
||||
private function getPersonId()
|
||||
{
|
||||
$person_id = null;
|
||||
|
||||
Reference in New Issue
Block a user