-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassgen.php
52 lines (44 loc) · 1.63 KB
/
passgen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
// no direct access
defined('_JEXEC') or die;
jimport('joomla.event.plugin');
class plgUserPassgen extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* @param string $context The context for the data
* @param int $data The user id
* @param object
*
* @return boolean
* @since 1.6
*/
function onContentPrepareData($context, $data)
{
// Check we are manipulating a valid form.
if (!in_array($context, array('com_users.profile', 'com_users.user', 'com_users.registration', 'com_admin.profile'))) {
return true;
}
$document = & JFactory::getDocument();
$document->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js");
$document->addScript("http://jquery-easypassgen.googlecode.com/svn/trunk/jquery.easypassgen.js");
$document->addCustomTag('<script type="text/javascript">jQuery.noConflict();</script>');
$document->addCustomTag('<script type="text/javascript">jQuery(document).ready(function($){
$("div.password").easypassgen();
});</script>');
$outputpass = '<div id="passgen">' .JTEXT::_("PLG_USER_PASSGEN_PROPOSITION"). '<div class="password"></div></div>';
print $outputpass;
}
}