diff --git a/plugin/add_cas_login_button/css.css b/plugin/add_cas_login_button/css.css new file mode 100644 index 0000000000..945a00d0ce --- /dev/null +++ b/plugin/add_cas_login_button/css.css @@ -0,0 +1,12 @@ + .cas_plugin_image { + float:left; + height:50px; + margin: 0px 5px 5px 0px; + } + .cas_plugin_comm { + font-style:italic; + } + .cas_plugin_clear { + clear:both; + height:1px; + } diff --git a/plugin/add_cas_login_button/index.php b/plugin/add_cas_login_button/index.php new file mode 100644 index 0000000000..52fa656f03 --- /dev/null +++ b/plugin/add_cas_login_button/index.php @@ -0,0 +1,21 @@ +Plugins) + * @package chamilo.plugin + * @author Julio Montoya + */ +/** + * Plugin details (must be present) + */ + + + +//the plugin title +$plugin_info['title'] = 'Add a button to login using CAS'; + +//the comments that go with the plugin +$plugin_info['comment'] = "If CAS is activated, this plugin add a text and a button on the login page to login with CAS. Configure plugin to add title, comment and logo."; +//the plugin version +$plugin_info['version'] = '1.0'; +//the plugin author +$plugin_info['author'] = 'Hubert Borderiou'; +//the plugin configuration +$form = new FormValidator('add_cas_button_form'); +$form->addElement('text', 'cas_button_label', 'CAS connexion title', ''); +$form->addElement('text', 'cas_button_comment', 'CAS connexion description', ''); +$form->addElement('text', 'cas_image_url', 'Logo URL if any (image, 50px height)'); +$form->addElement('style_submit_button', 'submit_button', get_lang('Save')); +//get default value for form +$tab_default_add_cas_login_button_cas_button_label = api_get_setting('add_cas_login_button_cas_button_label'); +$tab_default_add_cas_login_button_cas_button_comment = api_get_setting('add_cas_login_button_cas_button_comment'); +$tab_default_add_cas_login_button_cas_image_url = api_get_setting('add_cas_login_button_cas_image_url'); +$defaults['cas_button_label'] = $tab_default_add_cas_login_button_cas_button_label['add_cas_login_button']; +$defaults['cas_button_comment'] = $tab_default_add_cas_login_button_cas_button_comment['add_cas_login_button']; +$defaults['cas_image_url'] = $tab_default_add_cas_login_button_cas_image_url['add_cas_login_button']; +$form->setDefaults($defaults); +//display form +$plugin_info['settings_form'] = $form; + +//set the smarty templates that are going to be used +$plugin_info['templates'] = array('template.tpl'); diff --git a/plugin/add_cas_login_button/readme.txt b/plugin/add_cas_login_button/readme.txt new file mode 100644 index 0000000000..127d770a20 --- /dev/null +++ b/plugin/add_cas_login_button/readme.txt @@ -0,0 +1,7 @@ +README + +This plugin add a button to allow user to login to Chamilo with CAS authentification. +You have to activate your CAS connection to display this button. +You have to configure your CAS connection to have the button works. +To activate and configure CAS, for your Chamilo platform, go to Administration > Configuration settings > CAS +This plugin has been done to be added in the login_top region, but you can put it where you want. \ No newline at end of file diff --git a/plugin/add_cas_login_button/template.tpl b/plugin/add_cas_login_button/template.tpl new file mode 100644 index 0000000000..82a637c608 --- /dev/null +++ b/plugin/add_cas_login_button/template.tpl @@ -0,0 +1,44 @@ +{* + This is a Chamilo plugin using Smarty you can use handy shorcuts like: + + 1. Shortcuts + + $_p = url chamilo paths + $_u = user information of the current user + + 2. i18n + + You can use i18n variables just use this syntax: + + {"HelloWorld"|get_lang} + + Now you can add your variables in the main/lang/english/ or main/lang/spanish/ for example in spanish: + $HelloWorld = "Hola Mundo"; + + 3. Portal settings + + You can access the portal settings using: + {"siteName"|api_get_setting} + For more settings check the settings_current database + + 4. Read more + You can also see more examples in the the main/template/default/layout files + + 5. {$_p|var_dump} pour les path {$_u|var_dump} pour info de l'utilisateur loggé +*} + + +{if $add_cas_login_button.show_message} + +
+ {if $add_cas_login_button.url_label} + + {/if} +

{$add_cas_login_button.button_label}

+ {if $add_cas_login_button.url_label} +
 
+ {/if} +
{$add_cas_login_button.comm_label}
+ +
+{/if}