equal
deleted
inserted
replaced
608 if (PEAR::isError($response)) { error($response->getMessage()); return false; } |
608 if (PEAR::isError($response)) { error($response->getMessage()); return false; } |
609 |
609 |
610 $perm_templ_id = $db->lastInsertId('perm_templ', 'id'); |
610 $perm_templ_id = $db->lastInsertId('perm_templ', 'id'); |
611 |
611 |
612 foreach ($details['perm_id'] AS $perm_id) { |
612 foreach ($details['perm_id'] AS $perm_id) { |
613 $r_insert_values[] = "(" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")"; |
613 $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($perm_templ_id) . "," . $db->quote($perm_id) . ")"; |
614 } |
614 $result = $db->query($query); |
615 $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ; |
615 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
616 $result = $db->query($query); |
616 } |
617 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
|
618 |
617 |
619 return true; |
618 return true; |
620 } |
619 } |
621 |
620 |
622 // Update all details of a permission template. |
621 // Update all details of a permission template. |
644 $query = "DELETE FROM perm_templ_items WHERE templ_id = " . $details['templ_id'] ; |
643 $query = "DELETE FROM perm_templ_items WHERE templ_id = " . $details['templ_id'] ; |
645 $result = $db->query($query); |
644 $result = $db->query($query); |
646 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
645 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
647 |
646 |
648 foreach ($details['perm_id'] AS $perm_id) { |
647 foreach ($details['perm_id'] AS $perm_id) { |
649 $r_insert_values[] = "(" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")"; |
648 $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($details['templ_id']) . "," . $db->quote($perm_id) . ")"; |
650 } |
649 $result = $db->query($query); |
651 $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES " . implode(',', $r_insert_values) ; |
650 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
652 $result = $db->query($query); |
651 } |
653 if (pear::iserror($response)) { error($response->getmessage()); return false; } |
|
654 |
652 |
655 return true; |
653 return true; |
656 } |
654 } |
657 |
655 |
658 function update_user_details($details) { |
656 function update_user_details($details) { |