2 /* This program is free software. It comes without any warranty, to
3 * the extent permitted by applicable law. You can redistribute it
4 * and/or modify it under the terms of the Do What The Fuck You Want
5 * To Public License, Version 2, as published by Sam Hocevar. See
6 * http://sam.zoy.org/wtfpl/COPYING for more details. */
10 global $db,$error,$node;
11 $node_id=$node['node_id'];
12 $ops=explode(";",$_POST['oplist']);
14 $db->query("update node_access set node_permission='' where node_id=$node_id and node_permission='op'");
15 foreach ($ops as $op) {
16 $set=$db->query("select user_id from users where login='$op'");
18 if ($set->getString('user_id')) {
19 $q="update node_access set node_permission='op' where node_id=$node_id and user_id='".$set->getString('user_id')."'";
20 $changed=$db->update($q);
22 $q="insert into node_access set node_permission='op',node_id=$node_id,user_id=".$set->getString('user_id');
26 log::log('add op',$node_id,'ok',$op);
28 else { $error .= "$op does not exist..."; }