Last active
November 4, 2015 07:19
-
-
Save SirPilgrims/96ac786829f717a916b9 to your computer and use it in GitHub Desktop.
CAKEPHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /app/Plugin/Usermgmt/View/Users/dashboard.ctp | |
/* | |
This file is part of UserMgmt. | |
Author: Chetan Varshney (http://ektasoftwares.com) | |
UserMgmt is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
UserMgmt is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with Foobar. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
?> | |
<div class="umtop"> | |
<?php echo $this->Session->flash(); ?> | |
<?php echo $this->element('dashboard'); ?> | |
<div class="openflow_manag"> | |
<div class="um_box_mid_content"> | |
<div class="um_box_mid_content_top"> | |
<span class="umstyle1"><?php echo __('Openflow'); ?></span> | |
<div style="clear:both"></div> | |
</div> | |
<div class="umhr"></div> | |
<div class="um_box_mid_content_mid"> | |
<div class="um_box_mid_content_mid_left"> | |
<br/> | |
<?php if ($this->UserAuth->getGroupName()=='Admin') { ?> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Services",true),"/manageServices") ?></span><br/><br/> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Policies",true),"/managePolicies") ?></span><br/><br/> | |
<?php } else { ?> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Services USER _",true),"/view_services") ?></span><br/><br/> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Services USER",true), array('plugin' => 'usermgmt', 'controller' => 'services', 'action' => 'viewServices')) ?></span><br/><br/> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Policies",true),"/manageUserPolicies?p=".$this->UserAuth->getUserId()); ?></span><br/><br/> | |
<?php } if(false){ ?> | |
<span class="umstyle6"><?php echo $this->Html->link(__("Statistics",true),"/dashboard") ?></span><br/><br/> | |
<?php } ?> | |
</div> | |
<div class="um_box_mid_content_mid_right" align="right"></div> | |
<div style="clear:both"></div> | |
</div> | |
</div> | |
</div> | |
<div class="um_box_down"></div> | |
<div class="um_box_up"></div> | |
<div class="um_box_mid"> | |
<div class="um_box_mid_content"> | |
<div class="um_box_mid_content_top"> | |
<span class="umstyle1"><?php echo __('Dashboard'); ?></span> | |
<span class="umstyle2" style="float:right"><?php echo $this->Html->link(__("Home",true),"/") ?></span> | |
<div style="clear:both"></div> | |
</div> | |
<div class="umhr"></div> | |
<div class="um_box_mid_content_mid"> | |
<div class="um_box_mid_content_mid_left"> | |
<br/> | |
<?php if ($this->UserAuth->getGroupName()=='Admin') { ?> | |
<!-- <span class="umstyle6"><?php echo $this->Html->link(__("Add User",true),"/addUser") ?></span><br/><br/> --> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Add User",true),"/addUser") ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("All Users",true),"/allUsers") ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Add Group",true),"/addGroup") ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("All Groups",true),"/allGroups") ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Permissions",true),"/permissions") ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Profile",true),"/viewUser/".$this->UserAuth->getUserId()) ?></span><br/><br/> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Edit Profile",true),"/editUser/".$this->UserAuth->getUserId()) ?></span><br/><br/> | |
<?php } ?> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Change Password",true),"/changePassword") ?></span><br/><br/> | |
<?php if ($this->UserAuth->getGroupName()!='Admin') { ?> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Profile",true),"/myprofile") ?></span><br/><br/> | |
<?php } ?> | |
</div> | |
<div class="um_box_mid_content_mid_right" align="right"></div> | |
<div style="clear:both"></div> | |
</div> | |
</div> | |
</div> | |
<div class="um_box_down"></div> | |
</div> | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /app/Plugin/Usermgmt/View/Services/manage_services.ctp | |
if ($this->UserAuth->getGroupName()=='Admin') { ?> | |
<div class="umtop umtop_new"> | |
<div class="status_message"></div> | |
<div class="caricamento"><img src="/app/webroot/img/loading.gif" style="margin-left: 350px; margin-top: 130px;"></div> | |
<?php echo $this->Session->flash(); ?> | |
<?php echo $this->element('dashboard'); ?> | |
<div class="um_box_up"></div> | |
<div class="um_box_mid"> | |
<div class="um_box_mid_content"> | |
<div class="um_box_mid_content_top"> | |
<span class="umstyle1"><?php echo __('Gestione Servizi'); ?></span> | |
<span class="umstyle2" style="float:right"><?php echo $this->Html->link(__("Sign Out",true),"/logout") ?></span> | |
<div style="clear:both"></div> | |
</div> | |
<div class="umhr"></div> | |
<div class="um_box_mid_content_mid" id="index"> | |
<div class="tipologia_cont"> | |
<div class="tipologia_cont_cont"> | |
<span class="umstyle7"><?php echo __('Tipologia Servizi'); ?></span> | |
<div id="lista_tipo" style="margin-top:10px;"> | |
<?php for($i=0; $i<count($types); $i++){ ?> | |
<div id="tipo_<?php echo $i; ?>" class="<?php if($i%2 == 0) echo "righe_pari"; else echo "righe_dispari";?>"> | |
<div class="nome"><?php echo urldecode($types[$i]['openflow_capability_type']['service_name']); ?></div> | |
<div class="elimina" onclick="elimina_tipo(<?php echo $types[$i]['openflow_capability_type']['id'].", ".$i; ?>)">Elimina</div> | |
<div class="modifica" onclick="modifica_tipo(<?php echo $types[$i]['openflow_capability_type']['id'].", ".$i; ?>)">Modifica</div> | |
<div class="clear"></div> | |
</div> | |
<?php } if(count($types)== 0 ) | |
echo "Nessuna tipologia presente!"; | |
?> | |
<div class="invisible" id="count_types"><?php echo count($types); ?></div> | |
</div> | |
<div style="text-align: center;"> | |
<!--<input type="button" value="Add Service" onclick="inserisci_tipo()" style="font-size: 11px; font-weight: bold; margin-top: 8px; width: 130px; cursor: pointer;"> | |
<?php echo $this->Html->link ('Add Service', '/saveService',array ('class'=>'button','target'=>'_blank'))?>--> | |
<span class="umstyle6 elem_s"><?php echo $this->Html->link(__("Add Service Type",true),"/addServices") ?></span><br/><br/> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="umhr" style="margin-top: 25px;"></div> | |
<span class="umstyle7"><?php echo __('Dettaglio Servizi'); ?></span> | |
<div style="margin-top:10px;"> | |
<div class="righe_pari" style="border: 1px solid #2485B2; padding: 0; border-left: 0;"> | |
<div class="voce elem1">Tipologia</div> | |
<div class="voce elem2">node</div> | |
<div class="voce elem3">in_port</div> | |
<div class="voce elem4">out_port</div> | |
<div class="voce elem5">descrizione</div> | |
<div class="clear"></div> | |
</div> | |
<div id="lista_servizi"> | |
<?php for($i=0; $i<count($services); $i++){ ?> | |
<div id="servizio_<?php echo $i; ?>" class="<?php if($i%2 != 0) echo "righe_pari"; else echo "righe_dispari";?>" style="padding: 0; text-align:center;<?php if($i==(count($services)-1)) echo "border-bottom: 1px solid #2485B2;"; ?>"> | |
<div class="voce2 nome elem1"><?php echo urldecode($services[$i]['openflow_capability_type']['service_name']); ?></div> | |
<div class="voce2 elem2"><?php echo urldecode($services[$i]['openflow_capability']['datapath_id']); ?></div> | |
<div class="voce2 elem3"><?php echo $services[$i]['openflow_capability']['in_port']; ?></div> | |
<div class="voce2 elem4"><?php echo $services[$i]['openflow_capability']['out_port']; ?></div> | |
<div class="voce2 elem5"><?php echo urldecode($services[$i]['openflow_capability']['description']); ?></div> | |
<div class="elimina2" onclick="elimina_servizio(<?php echo $services[$i]['openflow_capability']['id'].", ".$i; ?>)">Elimina</div> | |
<div class="modifica" onclick="modifica_servizio(<?php echo $services[$i]['openflow_capability']['id'].", ".$i; ?>)">Modifica</div> | |
<div class="clear"></div> | |
</div> | |
<?php } if(count($services) == 0 ) | |
echo "Nessuna servizio presente!"; | |
?> | |
</div> | |
<div class="invisible" id="count_services"><?php echo count($services); ?></div> | |
<div style="text-align: center;"><input type="button" value="Aggiungi Servizio" onclick="inserisci_servizio()" style="font-size: 11px; font-weight: bold; margin-top: 8px; width: 120px; cursor: pointer;"></div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="um_box_down"></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /app/Plugin/Usermgmt/Config/routes.php | |
/* | |
This file is part of UserMgmt. | |
Author: Chetan Varshney (http://ektasoftwares.com) | |
UserMgmt is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
UserMgmt is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with Foobar. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
// Routes for standard actions | |
Router::connect('/login', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'login')); | |
Router::connect('/logout', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'logout')); | |
Router::connect('/forgotPassword', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'forgotPassword')); | |
Router::connect('/activatePassword/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'activatePassword')); | |
Router::connect('/register', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'register')); | |
Router::connect('/changePassword', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'changePassword')); | |
Router::connect('/changeUserPassword/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'changeUserPassword')); | |
Router::connect('/addUser', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'addUser')); | |
Router::connect('/editUser/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'editUser')); | |
Router::connect('/deleteUser/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'deleteUser')); | |
Router::connect('/viewUser/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'viewUser')); | |
Router::connect('/userVerification/*', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'userVerification')); | |
Router::connect('/allUsers', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'index')); | |
Router::connect('/dashboard', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'dashboard')); | |
Router::connect('/permissions', array('plugin' => 'usermgmt', 'controller' => 'user_group_permissions', 'action' => 'index')); | |
Router::connect('/update_permission', array('plugin' => 'usermgmt', 'controller' => 'user_group_permissions', 'action' => 'update')); | |
Router::connect('/accessDenied', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'accessDenied')); | |
Router::connect('/myprofile', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'myprofile')); | |
Router::connect('/allGroups', array('plugin' => 'usermgmt', 'controller' => 'user_groups', 'action' => 'index')); | |
Router::connect('/addGroup', array('plugin' => 'usermgmt', 'controller' => 'user_groups', 'action' => 'addGroup')); | |
Router::connect('/editGroup/*', array('plugin' => 'usermgmt', 'controller' => 'user_groups', 'action' => 'editGroup')); | |
Router::connect('/deleteGroup/*', array('plugin' => 'usermgmt', 'controller' => 'user_groups', 'action' => 'deleteGroup')); | |
Router::connect('/emailVerification', array('plugin' => 'usermgmt', 'controller' => 'users', 'action' => 'emailVerification')); | |
//ALE | |
Router::connect('/view_services', array('plugin' => 'usermgmt', 'controller' => 'services', 'action' => 'viewServices')); | |
Router::connect('/manageServices', array('plugin' => 'usermgmt', 'controller' => 'services', 'action' => 'manageServices')); | |
Router::connect('/addServices', array('plugin' => 'usermgmt', 'controller' => 'services', 'action' => 'addServices')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// /app/Plugin/Usermgmt/Controller/ServicesController.php | |
/* | |
This file is part of UserMgmt. | |
Author: Chetan Varshney (http://ektasoftwares.com) | |
UserMgmt is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
UserMgmt is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with Foobar. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
App::uses('UserMgmtAppController', 'Usermgmt.Controller'); | |
class ServicesController extends UserMgmtAppController { | |
/** | |
* This controller uses following models | |
* | |
* @var array | |
*/ | |
public $uses = array('Usermgmt.User', 'Usermgmt.UserGroup', 'Usermgmt.LoginToken', 'Usermgmt.OpenflowCapability', 'Usermgmt.OpenflowCapabilityType', 'Usermgmt.OpenflowVisibility'); | |
/** | |
* Called before the controller action. You can use this method to configure and customize components | |
* or perform logic that needs to happen before each controller action. | |
* | |
* @return void | |
*/ | |
public function beforeFilter() { | |
parent::beforeFilter(); | |
$this->User->userAuth=$this->UserAuth; | |
} | |
/** | |
* Used to manage services | |
* | |
* @access public | |
* @return void | |
*/ | |
public function manageServices() { | |
$types=$this->OpenflowCapabilityType->allTypes(); | |
$this->set('types', $types); | |
$services=$this->OpenflowCapability->allServices(); | |
$this->set('services', $services); | |
//$this->set('types', $this->OpenflowCapabilityType->allTypes()); | |
//$this->set('services', $this->OpenflowCapability->allServices()); | |
} | |
/** | |
* Used to view services | |
* | |
* @access public | |
* @return void | |
*/ | |
public function viewServices(){ | |
$user_id = $this->UserAuth->getUserId(); | |
$services=$this->UserOpenflowVisibility->visibilityByUser($user_id); | |
$this->set('services', $services); | |
//$this->set("services", $this->UserOpenflowVisibility->visibilityByUser($user_id)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /app/Plugin/Usermgmt/View/Services/view_services.cpt | |
<div class="umtop umtop_new"> | |
<?php echo $this->Session->flash(); ?> | |
<?php echo $this->element('dashboard'); ?> | |
<div class="um_box_up"></div> | |
<div class="um_box_mid"> | |
<div class="um_box_mid_content"> | |
<div class="um_box_mid_content_top"> | |
<span class="umstyle1"><?php echo __('Available Services'); ?></span> | |
<span class="umstyle2" style="float:right"><?php echo $this->Html->link(__("Sign Out",true),"/logout") ?></span> | |
<div style="clear:both"></div> | |
</div> | |
<div class="umhr"></div> | |
<div class="um_box_mid_content_mid" id="index"> | |
<div class="tipologia_cont"> | |
<div class="tipologia_cont_cont"> | |
<span class="umstyle7"><?php echo __('Services List'); ?></span> | |
<div id="lista_tipo" style="margin-top:10px; padding-left: 100px; width: 200px;"> | |
<?php for($i=0; $i<count($services); $i++){ ?> | |
<div id="tipo_<?php echo $i; ?>" class="<?php if($i%2 == 0) echo "righe_pari"; else echo "righe_dispari";?>"> | |
<div class="nome" style="width:200px;"><?php echo urldecode($services[$i]['openflow_capability_type']['service_name']); ?></div> | |
<div class="clear"></div> | |
</div> | |
<?php } if(count($services) == 0 ) | |
echo "No service!"; | |
?> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<div class="um_box_down"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment