Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Contact Form
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Community Suite
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 12 Nov 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\front\contact;
|
||||
@@ -30,7 +29,7 @@ class _contact extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
if ( !static::canUseContactUs() )
|
||||
if ( !\IPS\Member::loggedIn()->canUseContactUs() )
|
||||
{
|
||||
\IPS\Output::i()->error( 'no_permission', '2S333/1', 403, '' );
|
||||
}
|
||||
@@ -48,7 +47,8 @@ class _contact extends \IPS\Dispatcher\Controller
|
||||
/* Get extensions */
|
||||
$extensions = \IPS\Application::allExtensions( 'core', 'ContactUs', FALSE, 'core', 'InternalEmail', TRUE );
|
||||
|
||||
|
||||
/* Don't let robots index this page, it has no value */
|
||||
\IPS\Output::i()->metaTags['robots'] = 'noindex';
|
||||
\IPS\Output::i()->sidebar['enabled'] = FALSE;
|
||||
\IPS\Output::i()->bodyClasses[] = 'ipsLayout_minimal';
|
||||
|
||||
@@ -100,46 +100,15 @@ class _contact extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is the current user allowed to use the contact us form
|
||||
* Can Use Contact Us
|
||||
*
|
||||
* @return bool
|
||||
* @return bool
|
||||
* @deprecated 4.3
|
||||
*/
|
||||
public static function canUseContactUs()
|
||||
{
|
||||
try
|
||||
{
|
||||
$module = \IPS\Application\Module::get( 'core', 'contact' );
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !\IPS\Member::loggedIn()->canAccessModule( $module ) )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* If all groups have access, we can */
|
||||
if( \IPS\Settings::i()->contact_access != '*' )
|
||||
{
|
||||
/* Check member */
|
||||
$member = \IPS\Member::loggedIn();
|
||||
$memberGroups = array_merge( array( $member->member_group_id ), array_filter( explode( ',', $member->mgroup_others ) ) );
|
||||
$accessGroups = explode( ',', \IPS\Settings::i()->contact_access );
|
||||
|
||||
/* Are we in an allowed group? */
|
||||
if( count( array_intersect( $accessGroups, $memberGroups ) ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
return \IPS\Member::loggedIn()->canUseContactUs();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user