Skip to content

Commit

Permalink
Rebuild 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jonerickson committed Jun 8, 2023
1 parent 826b026 commit 7241b72
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 5 deletions.
3 changes: 3 additions & 0 deletions data/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"ModCp": {
"Verification": "IPS\\stripeverification\\extensions\\core\\ModCp\\Verification"
},
"ModeratorPermissions": {
"Verifications": "IPS\\stripeverification\\extensions\\core\\ModeratorPermissions\\Verifications"
},
"Notifications": {
"Verification": "IPS\\stripeverification\\extensions\\core\\Notifications\\Verification"
}
Expand Down
2 changes: 2 additions & 0 deletions data/lang.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<word key="stripverification_verified_at" js="0">Verified At</word>
<word key="stripverification_submitted_at" js="0">Submitted At</word>
<word key="stripverification_verify" js="0">Actions</word>
<word key="modperms__stripeverification_Verifications" js="0">Verifications</word>
<word key="can_manage_verifications" js="0">Can manage verifications?</word>
</app>
</language>
3 changes: 3 additions & 0 deletions dev/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@
'stripverification_verified_at' => 'Verified At',
'stripverification_submitted_at' => 'Submitted At',
'stripverification_verify' => 'Actions',

'modperms__stripeverification_Verifications' => 'Verifications',
'can_manage_verifications' => 'Can manage verifications?'
];
6 changes: 3 additions & 3 deletions extensions/core/ModCp/Verification.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public function getTab()
*/
public function manage()
{
if (! \IPS\Member::loggedIn()->modPermission('can_manage_announcements')) {
\IPS\Output::i()->error('no_module_permission', '3S148/2', 403, '');
if (! \IPS\Member::loggedIn()->modPermission('can_manage_verifications')) {
\IPS\Output::i()->error('no_module_permission', '1APP/2', 403);
}

$table = new \IPS\Helpers\Table\Db(\IPS\stripeverification\System\Verification::$databaseTable, \IPS\Http\Url::internal('app=core&module=modcp&controller=modcp&tab=verifications'));
$table = new \IPS\Helpers\Table\Db(\IPS\stripeverification\System\Verification::$databaseTable, \IPS\Http\Url::internal('app=core&module=modcp&controller=modcp&tab=stripeverification'));
$table->tableTemplate = [\IPS\Theme::i()->getTemplate('tables', 'core', 'admin'), 'table'];
$table->rowsTemplate = [\IPS\Theme::i()->getTemplate('tables', 'core', 'admin'), 'rows'];
$table->include = ['member_id', 'verified', 'verified_at', 'submitted_at', 'verify'];
Expand Down
74 changes: 74 additions & 0 deletions extensions/core/ModeratorPermissions/Verifications.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* @brief Moderator Permissions
*
* @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/
*
* @since 08 Jun 2023
*/

namespace IPS\stripeverification\extensions\core\ModeratorPermissions;

/* To prevent PHP errors (extending class does not exist) revealing path */
if (! \defined('\IPS\SUITE_UNIQUE_KEY')) {
header((isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0').' 403 Forbidden');
exit;
}

/**
* Moderator Permissions
*/
class _Verifications
{
/**
* Get Permissions
*
* @code
);
* @endcode
*/
public function getPermissions(): array
{
return [
'can_manage_verifications' => 'YesNo',
];
}

/**
* Pre-save
*
* @note This can be used to adjust the values submitted on the form prior to saving
*
* @param array $values The submitted form values
* @return void
*/
public function preSave(&$values)
{

}

/**
* After change
*
* @param array $moderator The moderator
* @param array $changed Values that were changed
* @return void
*/
public function onChange($moderator, $changed)
{

}

/**
* After delete
*
* @param array $moderator The moderator
* @return void
*/
public function onDelete($moderator)
{

}
}
2 changes: 1 addition & 1 deletion hooks/userBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function hookData()
0 => [
'selector' => '#elUserNav > li.cNotifications.cUserNav_icon',
'type' => 'add_after',
'content' => '<li class=\'cNotifications cUserNav_icon\'>
'content' => '<li class=\'cVerifications cUserNav_icon\'>
<a href=\'{url="app=stripeverification&module=system&controller=verification"}\' id=\'elVerificationStatus\' data-ipsTooltip title=\'{lang="stripeverification_userbar" escape="true"}\' data-ipsDialog data-ipsDialog-size="narrow" data-ipsDialog-title=\'{lang="stripeverification_userbar" escape="true"}\' >
<i class=\'fa fa-solid fa-circle-check\'></i>
</a>
Expand Down
2 changes: 1 addition & 1 deletion setup/upg_10003/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "1.0.3",
"steps": {
"queries": false,
"lang": false,
"lang": true,
"theme": true,
"themeSettings": false,
"javascript": false,
Expand Down
15 changes: 15 additions & 0 deletions setup/upg_10003/lang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"normal": {
"added": [
"modperms__stripeverification_Verifications",
"can_manage_verifications"
],
"edited": [],
"removed": []
},
"js": {
"added": [],
"edited": [],
"removed": []
}
}

0 comments on commit 7241b72

Please sign in to comment.