# HG changeset patch # User Dan # Date 1249105341 14400 # Node ID 6edb31919f0ea1b54ff492974668797dac6cfb6b # Parent bbdd428926b9b3c0ece5debc4e54136eee7f1387 Added admin CP. Basic feature set is finished! diff -r bbdd428926b9 -r 6edb31919f0e YubikeyManagement.php --- a/YubikeyManagement.php Sat Aug 01 01:05:45 2009 -0400 +++ b/YubikeyManagement.php Sat Aug 01 01:42:21 2009 -0400 @@ -33,6 +33,7 @@ require(ENANO_ROOT . '/plugins/yms/backend.php'); require(ENANO_ROOT . '/plugins/yms/validate.php'); require(ENANO_ROOT . '/plugins/yms/validate-functions.php'); +require(ENANO_ROOT . '/plugins/yms/admincp.php'); /**!language** @@ -162,7 +163,31 @@ btn_delete_key: 'Delete key', btn_show_aes: 'Show AES secret', btn_show_converter: 'Binary encoding converter', - btn_show_client_info: 'View client info' + btn_show_client_info: 'View client info', + + // ADMIN + acp_title: 'Yubikey Management Server', + acp_heading_main: 'YMS configuration', + acp_th_main: 'Yubikey Management Server options', + acp_field_require_reauth_title: 'Require re-authentication to access YMS interface:', + acp_field_require_reauth_hint: 'This can be redundant and unnecessary if the sole purpose of your Enano installation is for YMS purposes.', + acp_field_require_reauth: 'YMS pages require re-authentication', + acp_field_claimauth_enable_title: 'Use external authentication when claiming Yubikeys:', + acp_field_claimauth_enable_hint: 'This allows you to require an additional value - for example, the receipt number from the user\'s Yubikey order - when Yubikeys are claimed.', + acp_field_claimauth_enable: 'Require additional field to claim a Yubikey', + acp_field_claimauth_url_title: 'URL to claim authentication server:', + acp_field_claimauth_url_hint: 'The following variables will be applied: + + This authentication uses the same protocol as other Yubikey authentication servers. See the YMS plugin page on enanocms.org for information on how to write an authentication server.
+ Example URL: http://10.4.27.3/wsapi/validateclaim?id=1&tid=%c&otp=%o&h=%h', + acp_field_claimauth_key_title: 'API key for authentication server:', + acp_field_claimauth_key_hint: 'If provided, YMS will sign the requests it makes to your authentication server. Leave blank to disable signature support.', + + acp_msg_saved: 'Your changes to the YMS configuration have been saved.', } } } diff -r bbdd428926b9 -r 6edb31919f0e yms/admincp.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yms/admincp.php Sat Aug 01 01:42:21 2009 -0400 @@ -0,0 +1,111 @@ +attachHook('session_started', "yms_add_admincp();"); + +function yms_add_admincp() +{ + global $paths; + + $paths->addAdminNode('adm_cat_appearance', 'yms_acp_title', 'YMS', scriptPath . '/plugins/yms/icons/admincp.png'); +} + +function page_Admin_YMS() +{ + // Security check + global $session; + if ( $session->auth_level < USER_LEVEL_ADMIN ) + return false; + + global $lang; + + if ( isset($_POST['submit']) ) + { + setConfig('yms_require_reauth', isset($_POST['require_reauth']) ? '1' : '0'); + setConfig('yms_claim_auth_enable', isset($_POST['claimauth_enable']) ? '1' : '0'); + setConfig('yms_claim_auth_field', $_POST['claimauth_field']); + setConfig('yms_claim_auth_url', $_POST['claimauth_url']); + setConfig('yms_claim_auth_key', $_POST['claimauth_key']); + + echo '
' . $lang->get('yms_acp_msg_saved') . '
'; + } + + acp_start_form(); + ?> +

get('yms_acp_heading_main'); ?>

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get('yms_acp_th_main'); ?>
+ get('yms_acp_field_require_reauth_title'); ?>
+ get('yms_acp_field_require_reauth_hint'); ?> +
+ +
+ get('yms_acp_field_claimauth_enable_title'); ?>
+ get('yms_acp_field_claimauth_enable_hint'); ?> +
+ +
+ get('yms_acp_field_claimauth_enable_title'); ?>
+ get('yms_acp_field_claimauth_enable_hint'); ?> +
+ +
+ get('yms_acp_field_claimauth_url_title'); ?>
+ get('yms_acp_field_claimauth_url_hint'); ?> +
+ +
+ get('yms_acp_field_claimauth_key_title'); ?>
+ get('yms_acp_field_claimauth_key_hint'); ?> +
+ +
+ +
+
+ + +