Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -30,16 +30,6 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission_guest', '2X215/3', 403, '' );
|
||||
}
|
||||
|
||||
if ( mb_strtolower( $_SERVER['REQUEST_METHOD'] ) == 'get' and \IPS\Settings::i()->nexus_https and \IPS\Request::i()->url()->data['scheme'] !== 'https' )
|
||||
{
|
||||
\IPS\Output::i()->redirect( \IPS\Request::i()->url()->setScheme('https') );
|
||||
}
|
||||
|
||||
/* Load Invoice */
|
||||
if ( isset( \IPS\Request::i()->id ) )
|
||||
{
|
||||
@@ -48,21 +38,43 @@ class _invoices extends \IPS\Dispatcher\Controller
|
||||
\IPS\Request::i()->do = 'printout';
|
||||
}
|
||||
|
||||
try
|
||||
if ( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
$this->invoice = \IPS\nexus\Invoice::loadAndCheckPerms( \IPS\Request::i()->id );
|
||||
try
|
||||
{
|
||||
$this->invoice = \IPS\nexus\Invoice::loadAndCheckPerms( \IPS\Request::i()->id );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2X215/1', 404, '' );
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
else if ( isset( \IPS\Request::i()->do ) and \IPS\Request::i()->do == 'printout' and isset( $_SESSION['nexusMember'] ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2X215/1', 404, '' );
|
||||
$this->invoice = \IPS\nexus\Invoice::load( \IPS\Request::i()->id );
|
||||
$guest = $this->invoice->guest_data;
|
||||
|
||||
if ( $guest['member']['email'] != $_SESSION['nexusMember']['email'] )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2X215/5', 404, '' );
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=invoices', 'front', 'clientsinvoices', array(), \IPS\Settings::i()->nexus_https ), \IPS\Member::loggedIn()->language()->addToStack('client_invoices') );
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission_guest', '2X215/6', 404, '' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->breadcrumb[] = array( \IPS\Http\Url::internal( 'app=nexus&module=clients&controller=invoices', 'front', 'clientsinvoices' ), \IPS\Member::loggedIn()->language()->addToStack('client_invoices') );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $this->invoice->url(), $this->invoice->title );
|
||||
\IPS\Output::i()->title = $this->invoice->title;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !\IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_module_permission_guest', '2X215/3', 403, '' );
|
||||
}
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('client_invoices');
|
||||
if ( isset( \IPS\Request::i()->do ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user