php-pastebin-v3 icon indicating copy to clipboard operation
php-pastebin-v3 copied to clipboard

Disabling Guests/

Open zerondar opened this issue 11 years ago • 1 comments

is there any way to disable guests from making pastes? (as max ° of lines 0 does not seem to stop them from pasting stuff)

and or an option that allows private pastes to be turned off

Thank you in advance.

zerondar avatar Sep 05 '14 15:09 zerondar

There is a way, although it requires one code-change.

The File you need: /pages/main.php

Replace:

$hook->add_block('pasteForm', '', '',740,10); 
$hook->add_block('pasteOptions', '', '',740,11);  
$hook->add_block('pasteName', '', '',740,12);  

with

if($startUp->isLogged())
{
    $hook->add_block('pasteForm', '', '',740,10)
    $hook->add_block('pasteOptions', '', '',740,11);
    $hook->add_block('pasteName', '', '',740,12);
} 

Guests will see an empty page while logged-in Users will still be able to create pastes.

If you want to disable it completly (ignore POST-Request from incoming pastes), replace one more line

$startUp->addPaste($userId,$title,$_POST['syntax'],$_POST['paste'],$_POST['expiration'],$_POST['exposure']);

with

if($startup->isLogged())
{
    $startUp->addPaste($userId,$title,$_POST['syntax'],$_POST['paste'],$_POST['expiration'],$_POST['exposure']);
}

JohnnyCrazy avatar Sep 07 '14 15:09 JohnnyCrazy