Beispiel #1
0
 public function clean_plugin_permissions($plugin_name)
 {
     $do_plugin_permission = new CRMPluginPermission();
     $permission = $do_plugin_permission->get_plugins_permission($plugin_name);
     if (false !== $permission) {
         $id = $permission['id'];
         $qry = "delete from `plugins_permissions` where `idplugins_permissions` = ?";
         $stmt = $this->getDbConnection()->executeQuery($qry, array($id));
         $qry = "delete from `plugins_permissions_attributes` where `idplugins_permissions` = ?";
         $stmt = $this->getDbConnection()->executeQuery($qry, array($id));
     }
 }
Beispiel #2
0
 /**
  * function to load the active plugins
  * the active plugins are loaded on persistent object to be accessed across the application
  * @param boolean $settings
  * @return void
  */
 public function load_active_plugins($settings = false)
 {
     $qry = "\n\t\tselect * from `" . $this->getTable() . "`";
     $stmt = $this->getDbConnection()->prepare($qry);
     $stmt->execute();
     if ($stmt->rowCount() > 0) {
         $plugins = array();
         $do_plugin_permission = new CRMPluginPermission();
         while ($row = $stmt->fetch()) {
             if (false === $settings) {
                 if (true === $do_plugin_permission->is_plugin_allowed($row["name"])) {
                     $plugins[$row["idplugins"]] = array("name" => $row["name"], "action_priority" => $row["action_priority"], "display_priority" => $row["display_priority"]);
                 }
             } else {
                 $plugins[$row["idplugins"]] = array("name" => $row["name"], "action_priority" => $row["action_priority"], "display_priority" => $row["display_priority"]);
             }
         }
         $this->active_plugins = $plugins;
     }
 }