root/devel-backup/units/tinymce/tinymce_userdetails_actions.php

Revision 230, 0.8 kB (checked in by sven, 3 years ago)

fixing eduforge bug 85

Line 
1 <?php
2
3     // Save the user's editor choice
4
5     if (logged_on && isset($_REQUEST['action']) && run("permissions:check",
6         array("userdetails:change",((int) $_REQUEST['id'])))) {
7
8         if (isset($_REQUEST['visualeditor']) && ($_REQUEST['visualeditor'] == "yes" || $_REQUEST['visualeditor'] == "no")) {
9
10             // Get the current value, will also create an initial entry if not yet set
11             $current = run('userdetails:editor', (int) $_REQUEST['id']);
12             $value   = $_REQUEST['visualeditor'];
13             $id      = (int) $_REQUEST['id'];
14
15             if ($current == $value) {
16                 $messages[] .= gettext("Your editor preferences have been saved");
17             } else {
18                 db_query("update user_flags set value = '$value' where flag = 'visualeditor' and user_id = $id");
19                 $messages[] .= gettext("Your editor preferences have been changed");
20             }
21         }
22     }
23
24 ?>
25
Note: See TracBrowser for help on using the browser.