1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Operation\ActiveRecord;
13
14 use ICanBoogie\Module;
15 use ICanBoogie\Operation;
16
17 18 19 20
21 class Unlock extends Operation
22 {
23 protected function reset()
24 {
25 global $core;
26
27 parent::reset();
28
29 $this->module = $core->modules[$this->request['module']];
30 $this->key = $this->request['key'];
31 }
32
33 protected function get_controls()
34 {
35 return array
36 (
37 self::CONTROL_PERMISSION => Module::PERMISSION_MAINTAIN,
38 self::CONTROL_OWNERSHIP => true
39 )
40
41 + parent::get_controls();
42 }
43
44 protected function validate(\ICanboogie\Errors $errors)
45 {
46 return true;
47 }
48
49 protected function process()
50 {
51 return $this->module->unlock_entry((int) $this->key);
52 }
53 }