Skip to main content
Recent Posts
21
Support / Re: External PHP page (on same domain) only accessible for logged in members.
Last post by Spuds -
Sure, I'll show you a quick snip that should work.   But first a notice.

The permission system is based on named permissions and not simple group access.  This is because being in a group may be additive or may be subtractive to your permissions.  You could be in a group and "loose" permissions.  So with that warning out of the way ...

Code: [Select]
<?php

/**
 * Define $ssi_guest_access variable before including SSI.php to handle guest access to your script.
 * false: follows the forum setting of "Allow guests to browse the forum"
 */
$ssi_guest_access = false;

// Include the SSI file.
require(__DIR__ . '/SSI.php');

/**
 * If you have "Allow guests to browse the forum" enabled but still do not want guest to access this script
 * then use the is_not_guest(); function after including SSI.  If they are a guest their journey ends at the next line.
 */
is_not_guest();

global $user_info;

$exists = false;

// 1 is the admin, always allowed
// 2 is a global moderator, generally allowed
// 99 is just some group id that you have defined
foreach ([1, 2, 99] as $value)
{
if (in_array($value, $user_info['groups'], true))
{
$exists = true;
break;
}
}

if (!$exists)
{
redirectexit();
}

echo '<!DOCTYPE html>
<html>
<head>
</head>
<body>
Guests can not see this
</body>
</html>';

Here you provide a list of allowed groups, is put in 1, 2, 99 as an example, and the code simply checks if you are in one of those groups.  But as I stated this simply means your in a group, not that a necessary you have some permission, it all depends on how you have setup your forum.  But for simple cases its just OK, certainly not ideal.
23
Support / Re: External PHP page (on same domain) only accessible for logged in members.
Last post by Spuds -
There are several ways to do this.  I'll provide a quick example below, you would place this in a xyz.php file in the same directory as you SSI.php  Read the comments I provided in the script for futher details

Code: [Select]
<?php

/**
 * Define $ssi_guest_access variable before including SSI.php to handle guest access to your script.
 * false: follows the forum setting of "Allow guests to browse the forum"
 */
$ssi_guest_access = false;

// Include the SSI file.
require(__DIR__ . '/SSI.php');

/**
 * If you have "Allow guests to browse the forum" enabled but still do not want guest to access this script
 * then use the is_not_guest(); function after including SSI.  If they are a guest their journey ends at the next line.
 */
is_not_guest();

echo '<!DOCTYPE html>
<html>
<head>
</head>
<body>
Guests can not see this
</body>
</html>';

In both cases they will be redirected to the login screen
25
Site Feedback / Re: Server Change
Last post by Spuds -
And just finished with some email "stuff" ....

They should now be SPF, DKIM, DMARC, and rDNS compliant.  I know we did not have all of these checks in place previously, but in any case barring the notorious Spam filters and lists, we should be in good shape to send. 

Still need to do some PBE testing as well, but at least registration style emails look good.
26
Localization / Re: Daily generated language packs
Last post by Spuds -
Well I know this is a late response  :grimacing: but this should now be fixed. https://translations.elkarte.net/

Previously I did not have shell access to the language site, only FTP, so I could not see what error was being thrown, or even test a fix.  Since we moved to a new server I got my SSH access back and was able to correct several things.

Once again the packages should regenerate each night.  There is a cron job that pulls the translations from transifex and then creates the actual package files that you can use on a site.

I also pushed the latest 1.1 language files, I don't think that had been done in some time, and as such new/modifed strings were not shown in transifex, but now its all up to date.
29
Site Feedback / Server Change
Last post by Spuds -
Had to perform the big-o-move to a new server yesterday. 

Wanted to updated the site to use PHP 8.2 and later 8.3 and yadda-yadda-yadda ended up shifting the site to a new host and instance.  Its now on PHP 8.2/Apache/MariaDB stack so pretty standard stuff.

PHP8+ will be required for ElkArte 2.0, and since I wanted to update the site to the latest code (still to do) I first needed to get the PHP version updated.

I believe everything is working, but as server directory names changed, new DB plus all of the DNS, SSL, fun, I could have missed a few issues.  So if something does not seen right or does not work, please let me know  :wink:
30
Feature Discussion / Re: Removing Cancel Button in Quick Edit Mode
Last post by Spuds -
I don't think drafts are part of the quick edit, that may be an option to at have any work saved in the event of a wrong click.  Just a thought. 

We could add the "are you sure" confirmation dialog. Possibly make it smart enough to only present that if there were edits.