This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Details to access Flarum | |
$api_url = "https://my.forum.url/api/token"; | |
$username = "my_flarum_user"; | |
$password = "my_flarum_pass"; | |
// CURL call | |
$ch = curl_init($api_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$api_url = "https://my.flarum.url/api/users"; | |
$token = $session->token; // See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
// This must be a token for a user with Administrator access | |
$new_username = "johnsmith"; | |
$new_password = "password1234"; | |
$new_email = "john.smith@example.org"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$api_url = "https://my.flarum.url/api/users/" . $userid; // See: https://gist.github.com/woganmay/4c15a0f7c16e41ab3a3ea1a73c595bf9 | |
$token = $session->token; // See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
// This must be a token for a user with Administrator access | |
$ch = curl_init($api_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_COOKIE['flarum_remember'])) | |
{ | |
$mysql = new mysqli("localhost", "flarum_sql_user", "flarum_sql_pass", "flarum_database"); | |
$result = $mysql->query("SELECT * FROM access_tokens WHERE id = '". $mysql->real_escape_string($_COOKIE['flarum_remember']) ."'"); | |
if ($result->num_rows == 0) | |
{ | |
// Invalid cookie | |
header('Location:https://my.laravel.site/login'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var thisHackInterval = setInterval(function(){ | |
// Check if app is available yet | |
if (typeof(app) == "object") | |
{ | |
// Set app routes to whatever I need | |
// This will repaint the DOM automatically | |
app.routes.settings.path = "https://my.laravel.site/preferences"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See: https://gist.github.com/woganmay/4c15a0f7c16e41ab3a3ea1a73c595bf9 | |
$api_url = sprintf("https://my.flarum.site/api/users/%s/avatar", $user->id); | |
// See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
$token = $session->token; | |
$ch = curl_init($api_url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See: https://gist.github.com/woganmay/4c15a0f7c16e41ab3a3ea1a73c595bf9 | |
$api_url = sprintf("https://my.flarum.site/api/users/%s/avatar", $user->id); | |
// See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
$token = $session->token; | |
$avatar_file = "/storage/avatars/1234.jpg"; // Absolute path preferred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function toMail($notifiable) | |
{ | |
return (new MailMessage) | |
->subject('Mail Subject') | |
->greeting('Hi, User!') | |
->line('A line before the big button') | |
->action('Action Button', url('/')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function build() | |
{ | |
return $this | |
->subject('Mail Subject') | |
->view('vendor.notifications.email')->with([ | |
"level" => "default", | |
"greeting" => "Hi, User!", | |
"introLines" => [ |