-
Notifications
You must be signed in to change notification settings - Fork 2
/
Plugin.php
84 lines (74 loc) · 1.99 KB
/
Plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php namespace Winterpk\Wordpress;
use System\Classes\PluginBase;
use App;
/**
* Wordpress Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Wordpress Components',
'description' => 'Provides functionality for various Wordpress components such as authentication',
'author' => 'Winter King',
'icon' => 'icon-wordpress'
];
}
public function boot()
{
$get = get();
if ( ! empty($_GET['verify'])) {
$get = get();
if (isset($get['email']) && filter_var($get['email'], FILTER_VALIDATE_EMAIL)){
$email = $get['email'];
}
if (isset($get['key']) && (strlen($get['key']) == 32)) {
$key = $get['key'];
}
if (isset($email) && isset($key)) {
$check = Auth::validate_user($email, $key);
return Redirect::to($this->property('redirect'));
} else {
return Redirect::to('/');
}
}
// Register Auth service provider
App::register('Winterpk\Wordpress\Classes\AuthServiceProvider');
}
public function registerSchedule($schedule)
{
$schedule->call(function() {
mail('[email protected]', 'test', 'test');
})->everyFiveMinutes();
}
public function cleanup()
{
mail('[email protected]', 'test', 'test');
}
public function registerComponents()
{
return [
'Winterpk\Wordpress\Components\Session' => 'session',
'Winterpk\Wordpress\Components\PasswordRecovery' => 'passwordrecovery',
'Winterpk\Wordpress\Components\Combo' => 'combo',
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Wordpress Components',
'description' => 'Wordpress database settings.',
'icon' => 'icon-wordpress',
'class' => 'Winterpk\Wordpress\Models\Settings',
'order' => 1
]
];
}
}