Justuno_Social - Version 1.0.4

Version Notes

Stable release. Add auto logging in user via API

Download this release

Release Info

Developer Justuno
Extension Justuno_Social
Version 1.0.4
Comparing to
See all releases


Version 1.0.4

app/code/community/Justuno/Social/Block/Dashboard.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Block_Dashboard extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
3
+ {
4
+ public function render(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+
7
+ $email = Mage::getStoreConfig('justuno/account/email',0);
8
+ $domain = Mage::getStoreConfig('justuno/account/domain',0);
9
+ $jusdata = Mage::getStoreConfig('justuno/account/embed',1);
10
+ if ($jusdata) {
11
+ $jusdata = json_decode($jusdata);
12
+ }
13
+ $dashboard = $jusdata->dashboard;
14
+
15
+ $this->setElement($element);
16
+ $html = $this->_getHeaderHtml($element);
17
+
18
+ if ($email && $jusdata) {
19
+ $html.= "<span>You are already connected. <a href=".Mage::helper('adminhtml')->getUrl("adminhtml/custom/index/").">Click here to disconnect if necessary</a></span>";
20
+ }
21
+ else{
22
+ foreach ($element->getSortedElements() as $field) {
23
+ $html.= $field->toHtml();
24
+ }
25
+ }
26
+
27
+ $html .= $this->_getFooterHtml($element);
28
+ return $html;
29
+ }
30
+ }
app/code/community/Justuno/Social/Block/Dashboard1.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Block_Dashboard1 extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
3
+ {
4
+ public function render(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+
7
+ $email = Mage::getStoreConfig('justuno/account/email',0);
8
+ $domain = Mage::getStoreConfig('justuno/account/domain',0);
9
+ $jusdata = Mage::getStoreConfig('justuno/account/embed',1);
10
+
11
+ if ($jusdata) {
12
+ $jusdata = json_decode($jusdata);
13
+ }
14
+ $dashboard = $jusdata->dashboard;
15
+
16
+ $this->setElement($element);
17
+ $html = $this->_getHeaderHtml($element);
18
+
19
+ if ($email && $jusdata) {
20
+ $html.= "<span>You are already connected. <a href=".Mage::helper('adminhtml')->getUrl("adminhtml/custom/index/").">Click here to disconnect if necessary</a></span>";
21
+ }
22
+ else{
23
+ foreach ($element->getSortedElements() as $field) {
24
+ $html.= $field->toHtml();
25
+
26
+ }
27
+ $html .= $this->_getFooterHtml($element);
28
+ return $html;
29
+ }
30
+
31
+
32
+ }
33
+ }
app/code/community/Justuno/Social/Block/Domain.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Block_Domain extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
3
+ {
4
+ public function render(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $email = Mage::getStoreConfig('justuno/account/email',0);
7
+ $domain = Mage::getStoreConfig('justuno/account/domain',0);
8
+ $jusdata = Mage::getStoreConfig('justuno/account/embed',1);
9
+ if ($jusdata) {
10
+ $jusdata = json_decode($jusdata);
11
+ }
12
+ $dashboard = $jusdata->dashboard;
13
+
14
+ $this->setElement($element);
15
+ $html = $this->_getHeaderHtml($element);
16
+
17
+ if ($email && $jusdata) {
18
+ $html.="<span>Justuno Dashboard <a href=".$dashboard." target='_blank'> Click here </a></span>";
19
+ }
20
+ else{
21
+ $justuno_link = Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/justuno");
22
+ $html.="<span>Please <a href=".$justuno_link."> click here </a> to first update your magento / justuno app settings.</span>";
23
+ }
24
+
25
+ $html .= $this->_getFooterHtml($element);
26
+ return $html;
27
+ }
28
+ }
app/code/community/Justuno/Social/Block/Widget.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Block_Widget extends Mage_Core_Block_Template
3
+ {
4
+ public function getEmbed()
5
+ {
6
+ $jusdata = Mage::getStoreConfig('advanced/account/embed');
7
+ if ($jusdata) {
8
+ $jusdata = json_decode($jusdata);
9
+ }
10
+ return $jusdata->embed;
11
+ }
12
+ }
app/code/community/Justuno/Social/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/Justuno/Social/Model/Adminhtml/Comment.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Model_Adminhtml_Comment{
3
+ public function getCommentText(){ //this method must exits. It returns the text for the comment
4
+ return "<a href='https://www.justuno.com/login.html' target='_blank'>Forget your password?</a>";
5
+ }
6
+ }
app/code/community/Justuno/Social/Model/Embed.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Model_Embed extends Mage_Core_Model_Config_Data
3
+ {
4
+ public function save()
5
+ {
6
+
7
+ $fdata = array();
8
+ foreach ($this->groups['register']['fields'] as $name=>$field) {
9
+ $fdata[$name] = $field['value'];
10
+ }
11
+
12
+ if($fdata['email'] && $fdata['password']){
13
+ $fdata['guid'] = "";
14
+ include_once dirname(__FILE__) . '/JustunoAccess.php';
15
+ $params = array('apiKey'=>JUSTUNO_KEY,
16
+ 'email'=>$fdata['email'],
17
+ 'domain'=>$fdata['domain'],
18
+ 'guid'=>$fdata['guid'],
19
+ 'phone'=>$fdata['phone']);
20
+ if($fdata['password'])
21
+ $params['password'] = $fdata['password'];
22
+ $jAccess = new JustunoAccess($params);
23
+ try {
24
+ $justuno = $jAccess->getWidgetConfig();
25
+ $jusdata = array();
26
+ $jusdata['dashboard'] = (string)$jAccess->getDashboardLink();
27
+ $jusdata['guid'] = (string)$justuno['guid'];
28
+ $jusdata['embed'] = (string)$justuno['embed'];
29
+ $embed_db = (string)json_encode($jusdata);
30
+ Mage::getConfig()->saveConfig('justuno/account/embed', $embed_db, 'default', 1);
31
+ Mage::getConfig()->saveConfig('justuno/account/email', $fdata['email'], 'default', 0);
32
+ Mage::getConfig()->saveConfig('justuno/account/password', $fdata['password'], 'default', 0);
33
+ Mage::getConfig()->saveConfig('justuno/account/domain', $fdata['domain'], 'default', 0);
34
+
35
+ }
36
+ catch(JustunoAccessException $e) {
37
+ Mage::throwException($e->getMessage());
38
+ }
39
+ }
40
+ $flogindata = array();
41
+ foreach ($this->groups['account']['fields'] as $name=>$field) {
42
+ $flogindata[$name] = $field['value'];
43
+ }
44
+
45
+ if($flogindata['email'] && $flogindata['password']){
46
+ if ($flogindata['embed']) {
47
+ $obj = json_decode($flogindata['embed']);
48
+ $flogindata['embed'] = $obj->embed;
49
+ $flogindata['guid'] = $obj->guid;
50
+ }
51
+ include_once dirname(__FILE__) . '/JustunoAccess.php';
52
+ $login_params = array('apiKey'=>JUSTUNO_KEY,'email'=>$flogindata['email'],'domain'=>'','guid'=>$flogindata['guid']);
53
+
54
+ if($flogindata['password'])
55
+ $login_params['password'] = $flogindata['password'];
56
+ $jAccess = new JustunoAccess($login_params);
57
+ try {
58
+ //$justuno = $jAccess->getWidgetConfig();
59
+ $jusdata = array();
60
+ $jusdata['dashboard'] = (string)$jAccess->getDashboardLink();
61
+ $jusdata['guid'] = (string)$justuno['guid'];
62
+ $jusdata['embed'] = (string)$justuno['embed'];
63
+ $flogin_embed_db = (string)json_encode($jusdata);
64
+
65
+ $storeCode = 'default';
66
+ $store = Mage::getModel('core/store')->load($storeCode);
67
+ $path = 'justuno/account/embed';
68
+ $config = Mage::getModel('core/config_data');
69
+ $config->setValue($flogin_embed_db);
70
+ $config->setPath($path);
71
+ $config->setScope('default');
72
+ $config->setScopeId($store->getId());
73
+ $config->save();
74
+
75
+ Mage::getConfig()->saveConfig('justuno/account/email', $flogindata['email'], 'default', 0);
76
+ Mage::getConfig()->saveConfig('justuno/account/password', $flogindata['password'], 'default', 0);
77
+ Mage::getConfig()->saveConfig('justuno/account/domain', $flogindata['domain'], 'default', 0);
78
+ }
79
+ catch(JustunoAccessException $e) {
80
+ Mage::throwException($e->getMessage());
81
+ }
82
+ }
83
+ return parent::save();
84
+ }
85
+ }
app/code/community/Justuno/Social/Model/JustunoAccess.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ define('JUSTUNO_KEY', '467cd758-5745-4385-906b-6c76271c343a');
3
+ /**
4
+ * @file
5
+ * Class to perform operations with Justuno server.
6
+ *
7
+ * @version 13-08-2013
8
+ */
9
+
10
+ class JustunoAccess {
11
+ protected $apiKey;
12
+ protected $domain;
13
+ protected $email;
14
+ protected $apiEndpointUrl;
15
+ protected $guid;
16
+ protected $password;
17
+
18
+ /**
19
+ * Set initial data in constructor.
20
+ */
21
+ public function __construct($settings) {
22
+ $this->apiKey = $settings['apiKey'];
23
+ $this->domain = $settings['domain'];
24
+ $this->email = $settings['email'];
25
+ $this->guid = isset($settings['guid']) ? $settings['guid'] : NULL;
26
+ $this->password = isset($settings['password']) ? $settings['password'] : NULL;
27
+ $this->apiEndpointUrl = 'https://www.justuno.com/api/endpoint.html';
28
+ }
29
+
30
+ /**
31
+ * Retreives Justuno widget data.
32
+ */
33
+ public function getWidgetConfig() {
34
+ if (!extension_loaded("curl")) {
35
+ throw new JustunoAccessException('Plug-in requires php `curl` extension which seems to be not activated on this server. Please activate it.');
36
+ }
37
+ $params = array(
38
+ 'key' => $this->apiKey,
39
+ 'email' => $this->email,
40
+ 'domain' => $this->domain,
41
+ 'action' => 'install',
42
+ );
43
+ if (isset($this->password)) {
44
+ $params['password'] = $this->password;
45
+ }
46
+ $query = http_build_query($params);
47
+ $tucurl = curl_init();
48
+ curl_setopt($tucurl, CURLOPT_URL, "{$this->apiEndpointUrl}?$query");
49
+ curl_setopt($tucurl, CURLOPT_SSL_VERIFYPEER, FALSE);
50
+ curl_setopt($tucurl, CURLOPT_RETURNTRANSFER, 1);
51
+ $tudata = curl_exec($tucurl);
52
+ try {
53
+ if (curl_errno($tucurl)) {
54
+ throw new Exception(curl_error($tucurl));
55
+ }
56
+ $dom = new DOMDocument();
57
+ $dom->loadXML($tudata);
58
+ $nodes = $dom->getElementsByTagName('result');
59
+ if (!$nodes || ($nodes->length == 0)) {
60
+ throw new Exception('Incorrect response from remote server');
61
+ }
62
+
63
+ if ($nodes->item(0)->nodeValue == 0) {
64
+ $nodes = $dom->getElementsByTagName('error');
65
+ throw new Exception($nodes->item(0)->nodeValue);
66
+ }
67
+ $justuno_conf = array();
68
+ $nodes = $dom->getElementsByTagName('guid');
69
+ if ($nodes && $nodes->length !== 0) {
70
+ $this->guid = $justuno_conf['guid'] = $nodes->item(0)->nodeValue;
71
+ }
72
+ $nodes = $dom->getElementsByTagName('embed');
73
+ if ($nodes && $nodes->length !== 0) {
74
+ $justuno_conf['embed'] = $nodes->item(0)->nodeValue;
75
+ }
76
+ $nodes = $dom->getElementsByTagName('conversion');
77
+ if ($nodes && $nodes->length !== 0) {
78
+ $justuno_conf['conversion'] = $nodes->item(0)->nodeValue;
79
+ }
80
+ curl_close($tucurl);
81
+ return $justuno_conf;
82
+ }
83
+ catch (Exception $e) {
84
+ curl_close($tucurl);
85
+ throw new JustunoAccessException('Request error: ' . $e->getMessage());
86
+ }
87
+
88
+ }
89
+
90
+ /**
91
+ * Get link to Jutsuno dashbord link using API
92
+ */
93
+ public function getDashboardLink() {
94
+ $params = array(
95
+ 'key'=>$this->apiKey,
96
+ 'email'=>$this->email,
97
+ 'domain'=>$this->domain,
98
+ 'action'=>'login',
99
+ 'guid'=>$this->guid
100
+ );
101
+
102
+ if(isset($this->password)){
103
+ $params['password'] = $this->password;
104
+ }
105
+ $query = http_build_query($params);
106
+ $tuCurl = curl_init();
107
+ curl_setopt($tuCurl, CURLOPT_URL, "{$this->apiEndpointUrl}?$query");
108
+ curl_setopt($tuCurl,CURLOPT_SSL_VERIFYPEER,false);
109
+ curl_setopt($tuCurl, CURLOPT_RETURNTRANSFER, 1);
110
+ $tuData = curl_exec($tuCurl);
111
+ try{
112
+ if(curl_errno($tuCurl)){
113
+ throw new Exception(curl_error($tuCurl));
114
+ }
115
+ $dom = new DOMDocument;
116
+ $dom->loadXML($tuData);
117
+ $nodes = $dom->getElementsByTagName('result');
118
+ if(!$nodes || $nodes->length == 0)
119
+ throw new Exception('Incorrect response from remote server');
120
+
121
+ if($nodes->item(0)->nodeValue == 0){
122
+ $nodes = $dom->getElementsByTagName('error');
123
+ throw new Exception($nodes->item(0)->nodeValue);
124
+ }
125
+ $nodes = $dom->getElementsByTagName('secure_login_url');
126
+ if($nodes && $nodes->length !== 0){
127
+ $secureLoginUrl = $nodes->item(0)->nodeValue;
128
+ }
129
+ curl_close($tuCurl);
130
+ return $secureLoginUrl;
131
+ }
132
+ catch(Exception $e){
133
+ curl_close($tuCurl);
134
+ throw new JustunoAccessException('Request error: '.$e->getMessage());
135
+ }
136
+ }
137
+ }
138
+
139
+
140
+ /**
141
+ * Exception child to throw.
142
+ */
143
+ class JustunoAccessException extends Exception {
144
+
145
+ }
app/code/community/Justuno/Social/controllers/Adminhtml/CustomController.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Justuno_Social_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ Mage::getConfig()->saveConfig('justuno/account/embed', '', 'default', 1);
7
+ Mage::getConfig()->saveConfig('justuno/account/email', '', 'default', 0);
8
+ Mage::getConfig()->saveConfig('justuno/account/password', '', 'default', 0);
9
+ Mage::getConfig()->saveConfig('justuno/account/domain', '', 'default', 0);
10
+
11
+ Mage::getConfig()->saveConfig('justuno/register/embed', '', 'default', 0);
12
+ Mage::getConfig()->saveConfig('justuno/register/email', '', 'default', 0);
13
+ Mage::getConfig()->saveConfig('justuno/register/password', '', 'default', 0);
14
+ Mage::getConfig()->saveConfig('justuno/register/domain', '', 'default', 0);
15
+ Mage::getConfig()->saveConfig('justuno/register/phone', '', 'default', 0);
16
+
17
+ $url = Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/section/justuno");
18
+ $this->_redirect('adminhtml/system_config/edit/section/justuno');
19
+ }
20
+
21
+ public function listAction()
22
+ {
23
+ $this->loadLayout()
24
+ ->_setActiveMenu('mycustomtab')
25
+ ->_title($this->__('List Action'));
26
+
27
+ $this->renderLayout();
28
+ }
29
+ }
app/code/community/Justuno/Social/etc/adminhtml.xml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <justuno translate="title" module="social">
12
+ <title>Justuno</title>
13
+ <sort_order>0</sort_order>
14
+ </justuno>
15
+ <dashboard translate="title" module="social">
16
+ <title>Dashboard</title>
17
+ <sort_order>1</sort_order>
18
+ </dashboard>
19
+ </children>
20
+ </config>
21
+ </children>
22
+ </system>
23
+ </children>
24
+ </admin>
25
+ </resources>
26
+ </acl>
27
+ </config>
app/code/community/Justuno/Social/etc/config.xml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Justuno_Social>
5
+ <version>1.0.4</version>
6
+ </Justuno_Social>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <social>
11
+ <class>Justuno_Social_Model</class>
12
+ <resourceModel>social_embed</resourceModel>
13
+ </social>
14
+ <social_embed>
15
+ <class>Justuno_Social_Model_Embed</class>
16
+ </social_embed>
17
+ </models>
18
+ <blocks>
19
+ <social>
20
+ <class>Justuno_Social_Block</class>
21
+ </social>
22
+ <social_domain>
23
+ <class>Justuno_Social_Block_Domain</class>
24
+ </social_domain>
25
+ <social_dashboard>
26
+ <class>Justuno_Social_Block_Dashboard</class>
27
+ </social_dashboard>
28
+ </blocks>
29
+ <helpers>
30
+ <social>
31
+ <class>Justuno_Social_Helper</class>
32
+ </social>
33
+ </helpers>
34
+ </global>
35
+ <adminhtml>
36
+ <acl>
37
+ <resources>
38
+ <all>
39
+ <title>Allow Everything</title>
40
+ </all>
41
+ <admin>
42
+ <children>
43
+ <system>
44
+ <children>
45
+ <config>
46
+ <children>
47
+ <justuno>
48
+ <title>Justuno</title>
49
+ </justuno>
50
+ </children>
51
+ </config>
52
+ </children>
53
+ </system>
54
+ </children>
55
+ </admin>
56
+ </resources>
57
+ </acl>
58
+ </adminhtml>
59
+ <frontend>
60
+ <layout>
61
+ <updates>
62
+ <social>
63
+ <file>justuno_social.xml</file>
64
+ </social>
65
+ </updates>
66
+ </layout>
67
+ </frontend>
68
+ <admin>
69
+ <routers>
70
+ <adminhtml>
71
+ <args>
72
+ <modules>
73
+ <foo_bar before="Mage_Adminhtml">Justuno_Social_Adminhtml</foo_bar>
74
+ </modules>
75
+ </args>
76
+ </adminhtml>
77
+ </routers>
78
+ </admin>
79
+ </config>
app/code/community/Justuno/Social/etc/system.xml ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <justuno translate="label">
5
+ <label>Justuno</label>
6
+ <sort_order>150</sort_order>
7
+ </justuno>
8
+ </tabs>
9
+ <sections>
10
+ <justuno translate="label" module="social">
11
+ <label>Account Settings</label>
12
+ <tab>justuno</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>0</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <account translate="label">
20
+ <label>Connect Magento to existing Justuno Account</label>
21
+ <frontend_type>text</frontend_type>
22
+ <frontend_model>social/dashboard</frontend_model>
23
+ <sort_order>0</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <email translate="label">
29
+ <label>Enter your justuno account email:</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>0</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <comment></comment>
36
+ </email>
37
+ <password translate="label">
38
+ <label>Enter your justuno account password:</label>
39
+ <frontend_type>password</frontend_type>
40
+ <sort_order>1</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ <comment></comment>
45
+ </password>
46
+ <forgetpassword translate="label">
47
+ <comment>
48
+ <model>social/adminhtml_comment</model>
49
+ </comment>
50
+ <frontend_type>hidden</frontend_type>
51
+ <sort_order>2</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </forgetpassword>
56
+ <domain translate="label">
57
+ <label></label>
58
+ <frontend_type>hidden</frontend_type>
59
+ <sort_order>3</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment></comment>
64
+ </domain>
65
+ <embed translate="label">
66
+ <label></label>
67
+ <frontend_type>hidden</frontend_type>
68
+ <backend_model>social/embed</backend_model>
69
+ <sort_order>3</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <comment></comment>
74
+ </embed>
75
+ </fields>
76
+ </account>
77
+
78
+ <register translate="label">
79
+ <label>Create New Justuno Account</label>
80
+ <frontend_type>text</frontend_type>
81
+ <frontend_model>social/dashboard1</frontend_model>
82
+ <sort_order>1</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <fields>
87
+ <email translate="label">
88
+ <label>Enter an e-mail address:</label>
89
+ <frontend_type>text</frontend_type>
90
+ <sort_order>0</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
+ <comment></comment>
95
+ </email>
96
+ <phone translate="label">
97
+ <label>Enter your phone number:</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>3</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ <comment></comment>
104
+ </phone>
105
+ <password translate="label">
106
+ <label>Enter a password:</label>
107
+ <frontend_type>password</frontend_type>
108
+ <sort_order>1</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ <comment></comment>
113
+ </password>
114
+ <domain translate="label">
115
+ <label>Enter your website domain:</label>
116
+ <frontend_type>text</frontend_type>
117
+ <sort_order>2</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>1</show_in_website>
120
+ <show_in_store>1</show_in_store>
121
+ <comment></comment>
122
+ </domain>
123
+ <embed translate="label">
124
+ <label></label>
125
+ <frontend_type>hidden</frontend_type>
126
+ <backend_model>social/embed</backend_model>
127
+ <sort_order>3</sort_order>
128
+ <show_in_default>0</show_in_default>
129
+ <show_in_website>0</show_in_website>
130
+ <show_in_store>0</show_in_store>
131
+ <comment></comment>
132
+ </embed>
133
+ </fields>
134
+ </register>
135
+ </groups>
136
+
137
+
138
+ </justuno>
139
+ </sections>
140
+ <sections>
141
+ <dashboard translate="label" module="social">
142
+ <label>Dashboard</label>
143
+ <tab>justuno</tab>
144
+ <frontend_type>text</frontend_type>
145
+ <sort_order>0</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ <groups>
150
+ <dashboardlink translate="label">
151
+ <label>Dashboard</label>
152
+ <frontend_type>text</frontend_type>
153
+ <frontend_model>social/domain</frontend_model>
154
+ <sort_order>0</sort_order>
155
+ <show_in_default>1</show_in_default>
156
+ <show_in_website>1</show_in_website>
157
+ <show_in_store>1</show_in_store>
158
+ </dashboardlink>
159
+ </groups>
160
+ </dashboard>
161
+ </sections>
162
+ </config>
app/design/frontend/base/default/layout/justuno_social.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="after_body_start">
5
+ <block type="social/widget" name="justuno_social" as="justuno_social" template="justuno_social/widget.phtml" />
6
+ </reference>
7
+ </default>
8
+ </layout>
app/design/frontend/base/default/template/justuno_social/widget.phtml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Justuno Social plugin for Magento
4
+ *
5
+ * @category design
6
+ * @package base_default
7
+ * @author Justuno (http://www.justuno.com/)
8
+ * @copyright Copyright (c) 2013 Justuno (http://www.justuno.com/)
9
+ * @license Open Software License
10
+ */
11
+ ?>
12
+ <script>
13
+ <?php echo $this->getEmbed(); ?>
14
+
15
+ </script>
app/etc/modules/Justuno_Social.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @package Justuno_Social
5
+ */
6
+ -->
7
+ <config>
8
+ <modules>
9
+ <Justuno_Social>
10
+ <active>true</active>
11
+ <codePool>community</codePool>
12
+ <version>1.0.4</version>
13
+ </Justuno_Social>
14
+ </modules>
15
+ </config>
package.xml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Justuno_Social</name>
4
+ <version>1.0.4</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Convert website visitors into high quality fans, followers &amp; email subscribers with Justuno social offers.</summary>
10
+ <description>Justuno is the premier social marketing tool to convert website visitors to social and email leads via a simple instant offer widget on your site. In exchange for a coupon code, customers must either Facebook Like, Twitter Follow, Google+1, Join your mailing list or other available options all without ever having to leave your website. &#xD;
11
+ &lt;br /&gt;&lt;br /&gt;&#xD;
12
+ &lt;strong&gt;Key Features:&lt;/strong&gt;&lt;br /&gt;&#xD;
13
+ -Present instant offers in exchange for a social or email lead capture &lt;br /&gt;&#xD;
14
+ -Convert up to 3% of your daily website traffic&lt;br /&gt;&#xD;
15
+ -Easy to set-up and manage. No technical skills needed.&lt;br /&gt;&#xD;
16
+ -Available in any language&lt;br /&gt;&#xD;
17
+ &#xD;
18
+ &#xD;
19
+ To understand how Justuno works it&#x2019;s best to just see him in action ;) Please visit </description>
20
+ <notes>Stable release. Add auto logging in user via API</notes>
21
+ <authors><author><name>Justuno</name><user>MAG000180786</user><email>erik@justuno.com</email></author></authors>
22
+ <date>2013-10-16</date>
23
+ <time>13:49:14</time>
24
+ <contents>
25
+ <target name="magecommunity">
26
+ <dir name="Justuno">
27
+ <dir name="Social">
28
+ <dir name="Block">
29
+ <file name="Dashboard.php" hash="65c748c957380488645c75cbb292267a"/>
30
+ <file name="Dashboard1.php" hash=""/>
31
+ <file name="Domain.php" hash="d9375f0f7b4e9198793959a86e96d4de"/>
32
+ <file name="Widget.php" hash="5d61c43647ed55827acfd0bd3baed473"/>
33
+ </dir>
34
+ <dir name="Model">
35
+ <dir name="Adminhtml">
36
+ <file name="Comment.php" hash=""/>
37
+ </dir>
38
+ <file name="Embed.php" hash="c5a033a067c424ef17bcab29c192424c"/>
39
+ <file name="JustunoAccess.php" hash="092c586e980c5840c3db6775e260e93b"/>
40
+ </dir>
41
+ <dir name="Helper">
42
+ <file name="Data.php" hash=""/>
43
+ </dir>
44
+ <dir name="controllers">
45
+ <dir name="Adminhtml">
46
+ <file name="CustomController.php" hash=""/>
47
+ </dir>
48
+ </dir>
49
+ <dir name="etc">
50
+ <file name="adminhtml.xml" hash="798e1cb0f2843594e7b45d3601dfc6c4"/>
51
+ <file name="config.xml" hash="e82b6ecab3d744cb15a64e7170fb662c"/>
52
+ <file name="system.xml" hash="137c952fe96f7093a73e8144716107d5"/>
53
+ </dir>
54
+ </dir>
55
+ </dir>
56
+ </target>
57
+ <target name="magedesign">
58
+ <dir>
59
+ <dir name="frontend">
60
+ <dir name="base">
61
+ <dir name="default">
62
+ <dir name="layout">
63
+ <file name="justuno_social.xml" hash="d098f0a90ce0f311d0f233d416646183"/>
64
+ </dir>
65
+ <dir name="template">
66
+ <dir name="justuno_social">
67
+ <file name="widget.phtml" hash="7c6cbd4fe1df046562bc7bcc654f84d1"/>
68
+ </dir>
69
+ </dir>
70
+ </dir>
71
+ </dir>
72
+ </dir>
73
+ </dir>
74
+ </target>
75
+ <target name="mageetc">
76
+ <dir>
77
+ <dir name="modules">
78
+ <file name="Justuno_Social.xml" hash="936992f02fadf29a8de2af307d4c2dd0"/>
79
+ </dir>
80
+ </dir>
81
+ </target>
82
+ </contents>
83
+ <compatible/>
84
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
85
+ </package>