/** * The PHP Skeleton App * * @author Goran Halusa <*****@*****.**> * @copyright 2015 Goran Halusa * @link https://github.com/ghalusa/PHP-Skeleton-App * @license https://github.com/ghalusa/PHP-Skeleton-App/wiki/License * @version 0.1.1 * @package PHP Skeleton App * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Settings * * Settings for the User Account module. * * @author Goran Halusa <*****@*****.**> * @since 0.1.0 */ /** * Note that you are able to use any key that exists in * the global settings, and it will overwrite it */ $user_account_id = isset($_SESSION[$final_global_template_vars["session_key"]]["user_account_id"]) ? $_SESSION[$final_global_template_vars["session_key"]]["user_account_id"] : ""; $user_role_list = isset($_SESSION[$final_global_template_vars["session_key"]]["user_role_list"]) ? $_SESSION[$final_global_template_vars["session_key"]]["user_role_list"] : array(); $has_permission = array_intersect($user_role_list, $final_global_template_vars["role_perm_manage_all_accounts_access"]); $role_perm_manage_all_accounts_access = empty($has_permission) ? false : true; $default_module_settings = array("module_name" => $role_perm_manage_all_accounts_access ? "User Accounts" : "Your Account", "module_description" => $role_perm_manage_all_accounts_access ? "Manage user accounts for application." : "Manage your account.", "module_icon_path" => "/" . $_SERVER["CORE_TYPE"] . "/lib/images/icons/pixelistica-blue-icons/png/64x64/Users.png", "menu_hidden" => isset($_SESSION[$default_global_settings["session_key"]]) && $_SESSION[$default_global_settings["session_key"]] ? false : true, "pages" => $role_perm_manage_all_accounts_access ? array(array("label" => "Browse User Accounts", "path" => "/", "display" => apply_permissions("role_perm_browse_accounts_access", $final_global_template_vars)), array("label" => "Find User Account", "path" => "/find", "display" => apply_permissions("role_perm_manage_all_accounts_access", $final_global_template_vars))) : array(array("label" => "Manage Your Account", "path" => "/manage/" . $user_account_id, "display" => apply_permissions("role_perm_manage_accounts_access", $final_global_template_vars))), "sort_order" => 3, "proxy_id" => "3", "administrator_id" => array(1), "exclude_ids_from_selector" => array());
<?php /** * The PHP Skeleton App * * @author Goran Halusa <*****@*****.**> * @copyright 2015 Goran Halusa * @link https://github.com/ghalusa/PHP-Skeleton-App * @license https://github.com/ghalusa/PHP-Skeleton-App/wiki/License * @version 0.1.1 * @package PHP Skeleton App * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Routes * * Routes for the Group module. * * @author Goran Halusa <*****@*****.**> * @since 0.1.0 */ $app->get('/', "check_authenticated", apply_permissions("role_perm_browse_groups_access", $final_global_template_vars), "browse_groups"); $app->post('/datatables_browse_groups', "check_authenticated", apply_permissions("role_perm_browse_groups_access", $final_global_template_vars), "datatables_browse_groups"); $app->get('/manage(/:group_id)', "check_authenticated", apply_permissions("role_perm_manage_groups_access", $final_global_template_vars), "show_group_form"); $app->post('/manage(/:group_id)', "enforce_csrf_guard", "check_authenticated", apply_permissions("role_perm_manage_groups_access", $final_global_template_vars), "insert_update_group", "show_group_form"); $app->post('/delete', "enforce_csrf_guard", "check_authenticated", apply_permissions("role_perm_manage_groups_access", $final_global_template_vars), "delete_group");
<?php /** * The PHP Skeleton App * * @author Goran Halusa <*****@*****.**> * @copyright 2015 Goran Halusa * @link https://github.com/ghalusa/PHP-Skeleton-App * @license https://github.com/ghalusa/PHP-Skeleton-App/wiki/License * @version 0.1.1 * @package PHP Skeleton App * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Settings * * Settings for the Group module. * * @author Goran Halusa <*****@*****.**> * @since 0.1.0 */ /** * Note that you are able to use any key that exists in * the global settings, and it will overwrite it */ $default_module_settings = array("module_name" => "Groups", "module_description" => "Manage groups for application", "module_icon_path" => "/" . $_SERVER["CORE_TYPE"] . "/lib/images/icons/pixelistica-blue-icons/png/64x64/wired.png", "menu_hidden" => isset($_SESSION[$default_global_settings["session_key"]]) && $_SESSION[$default_global_settings["session_key"]] ? false : true, "pages" => array(array("label" => "Browse Groups", "path" => "/", "display" => apply_permissions("role_perm_browse_groups_access", $final_global_template_vars)), array("label" => "Create Group", "path" => "/manage", "display" => apply_permissions("role_perm_manage_groups_access", $final_global_template_vars))), "sort_order" => 4);
* @copyright 2015 Goran Halusa * @link https://github.com/ghalusa/PHP-Skeleton-App * @license https://github.com/ghalusa/PHP-Skeleton-App/wiki/License * @version 0.1.1 * @package PHP Skeleton App * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * Routes * * Routes for the User Account module. * * @author Goran Halusa <*****@*****.**> * @since 0.1.0 */ $app->get('/', "check_authenticated", apply_permissions("role_perm_browse_accounts_access", $final_global_template_vars), "browse_user_accounts"); $app->post('/datatables_browse_user_accounts', "check_authenticated", apply_permissions("role_perm_browse_accounts_access", $final_global_template_vars), "datatables_browse_user_accounts"); $app->get('/manage(/:user_account_id)', "check_authenticated", apply_permissions("role_perm_manage_accounts_access", $final_global_template_vars), $user_account_permissions, "show_user_account_form"); $app->post('/manage(/:user_account_id)', "enforce_csrf_guard", "check_authenticated", apply_permissions("role_perm_manage_accounts_access", $final_global_template_vars), $user_account_permissions, "insert_update_user_account", "show_user_account_form"); $app->get('/find', "check_authenticated", apply_permissions("role_perm_manage_all_accounts_access", $final_global_template_vars), "show_find_user_account_form"); $app->get('/find/(:q)', "check_authenticated", apply_permissions("role_perm_manage_all_accounts_access", $final_global_template_vars), "find_user_account"); $app->post('/delete', "enforce_csrf_guard", "check_authenticated", apply_permissions("role_perm_manage_all_accounts_access", $final_global_template_vars), $user_account_delete_permissions, "delete_user_account"); $app->get('/register/', "show_register_form"); $app->post('/register/', "enforce_csrf_guard", "insert_user_account", "show_register_form"); $app->get('/verify/', "verify_email"); $app->get('/password/', "show_reset_password_form"); $app->post('/password/', "enforce_csrf_guard", "reset_password"); $app->get('/reset/', "show_update_password_form"); $app->post('/reset/', "enforce_csrf_guard", "update_password");