diff --git a/adalogin/access.xml b/adalogin/access.xml new file mode 100644 index 0000000..e1c2c2b --- /dev/null +++ b/adalogin/access.xml @@ -0,0 +1,17 @@ + + +
+ + + + + + +
+
+ + + + +
+
\ No newline at end of file diff --git a/adalogin/admin/com_adalogin.xml b/adalogin/admin/com_adalogin.xml index f9cddac..b94469e 100644 --- a/adalogin/admin/com_adalogin.xml +++ b/adalogin/admin/com_adalogin.xml @@ -1,7 +1,7 @@ Adalogin - 2017-02-01 + 2016-11-08 Fogler Tibor tibor.fogler@gmail.com http://adatmagus.hu @@ -27,8 +27,6 @@ index.html router.php index.php - ada_obj.php - JoomlaInterface.php controllers helpers models @@ -37,7 +35,7 @@ language/en-GB.com_adalogin.ini - language/hu-HU.com_adalogin.ini + language/hu-HU.com_adalogin.ini Adalogin @@ -59,9 +57,12 @@ language/en-GB.com_adalogin.ini - language/hu-HU.com_adalogin.ini + language/hu-HU.com_adalogin.ini language/en-GB.com_adalogin.sys.ini - language/hu-HU.com_adalogin.sys.ini + language/hu-HU.com_adalogin.sys.ini - + + https://github.com/edemo/Joomla_oauth_plugin/raw/master/extension.xml + + \ No newline at end of file diff --git a/adalogin/admin/controllers/controller.php b/adalogin/admin/controllers/controller.php new file mode 100644 index 0000000..6c9239a --- /dev/null +++ b/adalogin/admin/controllers/controller.php @@ -0,0 +1,405 @@ +viewName = 'categories'; + $this->modelName = 'categories'; + $this->formName = 'categories'; + $this->defSort = 'a.id'; + $this->defOrder = 'asc'; + $this->defLimit = 20; + $this->defTask = 'browse'; + $this->lngPre = 'PVOKS_'; + } + + public function setViewName($viewName) { + $this->viewName = $viewName; + $this->modelName = $viewName; + $this->formName = $viewName;; + } + + /** + * bejelentkezett usernek van joga a task használatára? + * @param string task + * @param record vagy '' + * @return boolean + */ + protected function accessControl($task,$item) { + $result = true; + $user = JFactory::getUser(); + return $result; + } + + /** + * echo browser action buttons + * @params none + * @return void + */ + protected function browseButtons() { + ?> +

lngPre.'LIST'); ?>

+
+ accessControl('add','')) : ?> + + + accessControl('edit','')) :?> + + + accessControl('delete','')) :?> + + +
+ +

lngPre.'ADD'); ?>

+
+ + + +
+ +

lngPre.'EDIT');; ?>

+
+ + +
+ input; + if ($task == '') $task = $input->get('task'); + if ($task == '') $task = $this->defTask; + $this->$task (); + } + + + public function getModel($modelName = '') { + if ($modelName == '') $modelName = $this->modelName; + return parent::getModel($modelName); + } + + + public function getView($viewName='', $viewType='html') { + if ($viewName == '') $viewName = $this->viewName; + return parent::getView($viewName, $viewType); + } + + protected function getForm() { + return new JForm($this->formName); + } + + /** + * böngészés task + * @param string $msg üzenet + * @param string $msgClass üzent css class + */ + public function browse($msg = '', $msgClass = 'info') { + $session = JFactory::getSession(); + $input = JFactory::getApplication()->input; + $document = JFactory::getDocument(); + + if ($msg != '') + echo '
'.$msg.'
'; + + if (file_exists(JPATH_COMPONENT.'/views/'.$this->viewName.'/tmpl/default.js')) { + echo ' + '; + } + + + $model = $this->getModel($this->modelName); + $status = $model->getState($this->componentName.'.'.$this->viewName); + // ha új filter akkor a limitstartot nullázni kell + if ($input->get('newfilter')==1) $model->status->limitstart=0; + if ($input->get('clrfilter')==1) $model->status->limitstart=0; + $model->setState($this->componentName.'.'.$this->viewName); + $items = $items = $model->getItems(); + $view = $this->getView($this->viewName, 'html'); + $view->set('items',$items); + $view->set('total',$model->getTotal()); + $view->set('pagination', $model->getPagination()); + $view->setLayout('default'); + $this->browseButtons(); + $view->display(); + $this->browseButtons(); + } + + /** + * új felvitel képernyő + * fontos: a képernyőn MINDEN tábla mező legyen rajta (rejtett lehet), + * rejtett mezőkben legyen limit, limitstart, filter_str, filter_order, filter_order_Dir is + * hibaüzenet után $_GET['jform'] -ban form adatok is érkezhetnek + * @param string $msg üzenet + * @param string $msgClass üzent css class + */ + public function add($msg = '', $msgClass = 'info') { + $input = JFactory::getApplication()->input; + if ($this->accessControl('add','') == false) die(JText::_('ACCES_VIOLATION')); + $document = JFactory::getDocument(); + $session = JFactory::getSession(); + $session->set('lastTask','add'); + if ($msg != '') + echo '
'.$msg.'
'; + + if (file_exists(JPATH_COMPONENT.'/models/forms/'.$this->formName.'.xml')) + $form = &JForm::getInstance('adminForm', + JPATH_COMPONENT.'/models/forms/'.$this->formName.'.xml', + array('control' => 'jform')); + if (file_exists(JPATH_COMPONENT.'/views/'.$this->viewName.'/tmpl/form.js')) { + echo ' + '; + } + + $model = $this->getModel($this->modelName); + $jform = $input->get('jform','','array'); + if ($jform == '') + $item = $model->getItem(0); + else { + $item = new stdClass(); + foreach ($jform as $fn => $fv) + $item->$fn = $fv; + } + $form = $this->getForm(); + $form->bind($item); + $view = $this->getView($this->viewName, 'html'); + $view->set('item',$item); + $view->set('form',$form); + $view->setModel($model); + $view->setLayout('form'); + $this->addButtons(); + $view->display(); + $this->addButtons(); + } + + /** + * módosítás képernyő + * fontos: a képernyőn MINDEN tábla mező legyen rajta (rejtett lehet), + * rejtett mezőkben legyen limit, limitstart, filter_str, filter_order, filter_order_Dir is + * az id paraméter érkezhet GET['id'] -ben, vagy $_GET['cid'] egy elemü tömbben + * hibaüzenet után $_GET['jform'] -ban form adatok is érkezhetnek + * @param string $msg üzenet + * @param string $msgClass üzent css class + */ + public function edit($msg = '', $msgClass = 'info') { + $input = JFactory::getApplication()->input; + $document = JFactory::getDocument(); + $session = JFactory::getSession(); + $session->set('lastTask','edit'); + $usr = JFactory::getUser(); + if ($msg != '') + echo '
'.$msg.'
'; + $ids = array(); + + if (file_exists(JPATH_COMPONENT.'/models/forms/'.$this->formName.'.xml')) + $form = &JForm::getInstance('adminForm', + JPATH_COMPONENT.'/models/forms/'.$this->formName.'.xml', + array('control' => 'jform')); + if (file_exists(JPATH_COMPONENT.'/views/'.$this->viewName.'/tmpl/form.js')) { + echo ' + '; + } + + if ($input->get('id') != '') + $ids[0] = $input->get('id'); + else + $ids = $input->get('cid',array(),'array'); + if (count($ids) == 1) { + $model = $this->getModel($this->modelName); + $jform = $input->get('jform','','array'); + if ($jform == '') + $item = $model->getItem($ids[0]); + else { + $item = new stdClass(); + foreach ($jform as $fn => $fv) + $item->$fn = $fv; + } + if ($item == false) { + $this->browse(JText::_($this->lngPre.'NOT_FOUND'),'error'); + return; + } + if ($this->accessControl('edit',$item) == false) die(JText::_('ACCES_VIOLATION')); + $form = $this->getForm(); + $form->bind($item); + $view = $this->getView($this->viewName, 'html'); + $view->set('form',$form); + $view->set('item',$item); + $view->setModel($model); + $view->setLayout('form'); + $this->editButtons(); + $view->display(); + $this->editButtons(); + } else { + $this->browse(JText::_($this->lngPre.'SELECT_PLEASE'), 'hibaUzenet'); + } + } + + /** + * adat tárolás + */ + public function save() { + $input = JFactory::getApplication()->input; + $session = JFactory::getSession(); + if ($session->get('lastTask') == 'save') { + // a user refrest nyomott a böngészőben save után! + $this->browse('',''); + return; + } + $session->set('lastTask','save'); + JSession::checkToken( 'post' ) or die( 'Invalid Token' ); + $model = $this->getModel($this->modelName); + + $jform = $input->get('jform', array(), 'array'); + $item = new stdClass(); + foreach ($jform as $fn => $fv) $item->$fn = $fv; + + if ($this->accessControl('save',$item) == false) die(JText::_('ACCES_VIOLATION')); + $result = $model->save($item); + if ($result) { + $this->browse(JText::_($this->lngPre.'SAVED'),'infoUzenet'); + } else { + if ($item->id == 0) { + $this->add($model->getError(),'hibaUzenet'); + } else { + $input->set('id',$item->id); + $this->edit($model->getError(),'hibaUzenet'); + } + } + } + + /** + * rekord tölés + */ + public function delete() { + $input = JFactory::getApplication()->input; + $session = JFactory::getSession(); + $session->set('lastTask','delete'); + $session = JFactory::getSession(); + JSession::checkToken( 'get' ) or die( 'Invalid Token' ); + $model = $this->getModel($this->modelName); + $model->set('viewName',$this->viewName); + $model->set('viewName',$this->viewName); + $ids = $input->get('cid'); + if (count($ids) == 1) { + $item = $model->getItem($ids[0]); + if ($this->accessControl('delete',$item) == false) die(JText::_('ACCES_VIOLATION')); + $result = $model->delete($ids); + if ($result) { + $this->browse(JText::_($this->lngPre.'DELETED'),'infoUzenet'); + } else { + $this->browse($model->getError(),'hibaUzenet'); + } + } else { + $this->browse(JText::_($this->lngPre.'SELECT_PLEASE'), 'hibaUzenet'); + } + } + + /** + * rekord tárolás és új felvitel + */ + public function savenew() { + $input = JFactory::getApplication()->input; + $session = JFactory::getSession(); + if ($session->get('lastTask') == 'save') { + // a user refrest nyomott a böngészőben save után! + $this->browse('',''); + return; + } + $session->set('lastTask','save'); + JSession::checkToken( 'post' ) or die( 'Invalid Token' ); + $model = $this->getModel($this->modelName); + $jform = $input->post->get('jform', array(), 'array'); + $item = new stdClass(); + foreach ($jform as $fn => $fv) $item->$fn = $fv; + if ($this->accessControl('save',$item) == false) die(JText::_('ACCES_VIOLATION')); + $result = $model->save($item); + if ($result) { + $this->editNewInit($jform); + $input->post->set('jform', $jform, 'array'); + $this->add(JText::_($this->lngPre.'SAVED'),'infoUzenet'); + } else { + if ($item->id == 0) { + $this->add($model->getError(),'hibaUzenet'); + } else { + $input->set('id',$item->id); + $this->edit($model->getError(),'hibaUzenet'); + } + } + } +} +?> diff --git a/adalogin/admin/langauge b/adalogin/admin/langauge new file mode 100644 index 0000000..8009ab1 --- /dev/null +++ b/adalogin/admin/langauge @@ -0,0 +1,2 @@ +ADALOGIN="Adalogin" +Adalogin_DESC="ADA-login component" diff --git a/adalogin/admin/views/adalogin/tmpl/form.php b/adalogin/admin/views/adalogin/tmpl/form.php index 5123761..9d06451 100644 --- a/adalogin/admin/views/adalogin/tmpl/form.php +++ b/adalogin/admin/views/adalogin/tmpl/form.php @@ -59,5 +59,4 @@ - -

Az ADA rendszerből történő kijelentkezéshez a http://adaserver_domain/ada/v1/logout' url-t kell aktivizálni, egy láthatatlan iframe-be irányitva az outputot.

\ No newline at end of file + \ No newline at end of file diff --git a/adalogin/config.xml b/adalogin/config.xml new file mode 100644 index 0000000..fb69226 --- /dev/null +++ b/adalogin/config.xml @@ -0,0 +1,27 @@ + + + + + +
+
+
+ + +
+
\ No newline at end of file diff --git a/adalogin/site/adalogin.php b/adalogin/site/adalogin.php index e5256f9..f48ccee 100644 --- a/adalogin/site/adalogin.php +++ b/adalogin/site/adalogin.php @@ -6,15 +6,7 @@ * @license #GNU/GPL */ -// ADA server callback -// =================== -if (isset($_GET['code'])) { - include 'index.php'; - exit(); -} - -// call from joomla -// ================ +//--No direct access defined('_JEXEC') or die('=;)'); // DS has removed from J 3.0 if(!defined('DS')) { diff --git a/adalogin/site/assets/adalogin.js b/adalogin/site/assets/adalogin.js new file mode 100644 index 0000000..a25c292 --- /dev/null +++ b/adalogin/site/assets/adalogin.js @@ -0,0 +1,45 @@ + +/** + * Adatom.hu kijelentkezés AJAX lekérdezéssel + */ +function doAdaLogout() { + document.getElementById("errorNotLoggedIn").style.display = "none"; + document.getElementById("errorParse").style.display = "none"; + document.getElementById("errorHost").style.display = "none"; + + var xhttp; + if (window.XMLHttpRequest) { + xhttp = new XMLHttpRequest(); + } else { + xhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } + xhttp.onreadystatechange = function() { + if (this.readyState == 4) { + if (this.status == 200) { + var result; + try { + result = JSON.parse(this.responseText); + if (typeof result.message !== undefined) { + document.getElementById("adalogout").disabled = true; + document.getElementById("logoutDone").style.display = "block"; + } else { + for (var i in result.errors) { + if (result.errors[i] == "not logged in") { + console.error("You're not logged in!"); + document.getElementById("errorNotLoggedIn").style.display = "block"; + } + } + } + } catch(e) { + console.error(e); + document.getElementById("errorParse").style.display = "block"; + } + } else { + console.error("Host unreachable (code: "+this.status+")"); + document.getElementById("errorHost").style.display = "block"; + } + } + }; + xhttp.open("GET", "https://adatom.hu/ada/v1/logout", true); + xhttp.send(); +} diff --git a/adalogin/site/controller.php b/adalogin/site/controller.php index 4ddc2b1..8080740 100644 --- a/adalogin/site/controller.php +++ b/adalogin/site/controller.php @@ -7,7 +7,6 @@ * @license #GNU/GPL * * ADA authoraze service integarttion -* 2016.12.15 extradata kezelés. a registform -on "extrafields[filename]" nevü extra mezők lehetnek. */ // no direct access @@ -99,10 +98,7 @@ public function dologin() { $view->setModel($model,true); $user = $model->getUser($adaid, $adaemail); if ($user->id > 0) { - if ($assurance != $user->getParam('ASSURANCE')) { - $user->setParam('ASSURANCE',$assurance); - $user->save(); - } + $model->setUserAssurances($user, $assurance); // login to joomla if ($model->loginToJoomla($adaid, $adaemail)) { // goto $redi @@ -115,10 +111,24 @@ public function dologin() { $this->displayRegistForm($view, $adaid, $adaemail, $assurance, $redi); } } // dologin + + /** + * process logout + */ + public function dologout() { + $app = JFactory::getApplication(); + $app->logout(); + + $document = JFactory::getDocument(); + $view = $this->getView($this->_viewname, $document->getType()); + $model = &$this->getModel($this->_mainmodel); + $view->setModel($model,true); + $view->setLayout('logout'); + $view->display(); + } /** - * process registform adaid, adaemail, nick, assurance, redi , extrafields(array), CSRF_token data - * from from. caller: components/com_adalogin/index.php + * process registform adaid, adaemail, nick, assurance, redi , CSRF_token data from components/com_adalogin/index.php */ public function processform() { $input = JFactory::getApplication()->input; @@ -128,7 +138,6 @@ public function processform() { $redi = base64_decode($input->get('redi','','string')); if ($redi == '') $redi = JURI::base(); $nick = $input->get('nick'); - $extrafields = $input->get('extrafields',array(),'array'); $document = JFactory::getDocument(); $viewType = $document->getType(); $view = $this->getView($this->_viewname,$viewType); @@ -137,14 +146,10 @@ public function processform() { $model->set('PSW',$ada->joomla_psw); $view->setModel($model,true); if ($model->checkNewNick($nick)) { - if ($model->save($adaid, $nick, $adaemail, $assurance, $extrafields)) { + if ($model->save($adaid, $nick, $adaemail, $assurance)) { // login to joomla if ($model->loginToJoomla($adaid, $adaemail)) { - $user = JFactory::getUser(); - if ($assurance != $user->getParam('ASSURANCE')) { - $user->setParam('ASSURANCE',$assurance); - $user->save(); - } + $model->setUserAssurances($user, $assurance); // goto $redi $this->setRedirect($redi); $this->redirect(); @@ -160,30 +165,5 @@ public function processform() { $this->displayRegistForm($view, $adaid, $adaemail, $assurance, $redi); } } // processform - - /** - * logout - task loogout from joomla and from ADA - */ - public function logout() { - $app = JFactory::getApplication(); - $app->logout(); - $view = $this->getView($this->_viewname,'html'); - $view->setLayout('logout'); - $view->display(); - } - - /** - * Kilépés az ADA rendszerböl - */ - public function adalogout() { - echo '
- -
- '; - $view = $this->getView($this->_viewname,'html'); - $view->setLayout('adalogout'); - $view->display(); - } - }// class ?> \ No newline at end of file diff --git a/adalogin/site/index.php b/adalogin/site/index.php index 6273dc8..8c30930 100644 --- a/adalogin/site/index.php +++ b/adalogin/site/index.php @@ -18,16 +18,12 @@ require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' ); require_once ( JPATH_BASE .DS.'components'.DS.'com_adalogin'.DS.'models'.DS.'ada_obj.php'); - - JDEBUG ? $_PROFILER->mark( 'afterLoad' ) : null; $mainframe = JFactory::getApplication('site'); $mainframe->initialise(); jimport('joomla.plugin.helper'); jimport('joomla.user.helper'); $input = JFactory::getApplication()->input; -$language = JFactory::getLanguage(); -$language->load('com_adalogin', JPATH_SITE, null, true).'
'; // process code if ($input->get('code','','string')) { diff --git a/adalogin/site/langauge b/adalogin/site/langauge new file mode 100644 index 0000000..0b46a9b --- /dev/null +++ b/adalogin/site/langauge @@ -0,0 +1,15 @@ +ADALOGIN_REDI="Átirányitás URI sikeres belépés után" +ADALOGIN_REDI_DESC="A sikeres belépés után erre az oldalra kerül a felhasználó" +ADALOGIN_ADA_ID="ADA azonosító" +ADALOGIN_ADA_EMAIL="ADA e-mail" +ADALOGIN_NICKHELP="Most választania kell egy 'álnevet' amivel a Joomla rendszerben Ön azonosítva lesz. A többi felhasználó ezen a néven fogja Önt ismerni. természetesen valódi nevét is használhatja. Avatar képet a gravar.com oldalon tölthet fel, az itt látható e-mail címet kell használnia." +ADALOGIN_JOOMLA_NICK="Álnév" +ADALOGIN_OK="Tárolás" +ADALOGIN_JOOMLA_LOGIN_ERROR="Hiba lépett fel a bejelentkezési folyamatban" +ADALOGIN_NICK_USED="Ez az 'álnév' már foglalt. Válasszon másikat" +ADALOGIN_ERROR="Hiba lépett fel" +ADALOGIN_NICK_REQUED="'Álnevet' meg kell adni." +ADALOGIN_LOGOUTMSG="Kijelentkezett erről a web oldalról.
Az ADA rendszerben azonban továbbra is bejeltkezve marad.
Ha onnan is ki akar jelentkezni használja az alábbi linket!" +ADALOGIN_ADALOGOUT="Kijelentkezés az ADA rendszerböl" +ADALOGIN_ADALOGOUTMSG="Kijelentkezett az ADA rendszerből" + diff --git a/adalogin/site/models/ada_obj.php b/adalogin/site/models/ada_obj.php index e8e7582..8d7d4ef 100644 --- a/adalogin/site/models/ada_obj.php +++ b/adalogin/site/models/ada_obj.php @@ -8,6 +8,29 @@ */ + +class JoomlaInterface { + public function remoteCall($url,$method,$data,$extraHeader='') { + $result = ''; + if ($extraHeader != '') { + $extraHeader .= "\r\n"; + } + $options = array( + 'http' => array( + 'header' => "Content-type: application/x-www-form-urlencoded\r\n".$extraHeader, + 'method'=> $method, + 'content' => http_build_query($data) + ) + ); + $context = stream_context_create($options); + return file_get_contents($url, false, $context); + return $result; + } +} + +global $theJoomlaInterface; +$theJoomlaInterface = new JoomlaInterface(); + class AdaloginModelAda_obj { public $joomla_psw; @@ -18,8 +41,16 @@ class AdaloginModelAda_obj { protected $secret; protected $myURI; protected $home; + protected $interface; - function __construct() { + function __construct($iface = false) { + global $theJoomlaInterface; + if($iface) + { + $this->interface = $iface; + } else { + $this->interface = $theJoomlaInterface; + } $db = JFactory::getDBO(); $db->setQuery('select * from #__adalogin order by id limit 1'); $res = $db->loadObject(); @@ -29,19 +60,17 @@ function __construct() { $this->myURI = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $i = strpos($this->myURI,'?'); if ($i > 0) $this->myURI = substr($this->myURI,0,$i); - // https is wrong $this->home = str_replace('/components/com_adalogin','','https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $this->home = str_replace('/components/com_adalogin','','https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); $i = strpos($this->home,'?'); if ($i > 0) $this->home = substr($this->home,0,$i); - //$this->home = str_replace('/ssologin','',$this->home); // for old ssologin interface enviroment - //$this->home = str_replace('/adalogin','',$this->home); // for old adalogin interface enviroment + $this->home = str_replace('/ssologin','',$this->home); // for old ssologin interface enviroment + $this->home = str_replace('/adalogin','',$this->home); // for old adalogin interface enviroment } /** * redirect ADA server, get loginform. Call this method only in joomla component.controller */ public function getLoginURI($redi='') { - $redirectURI = JURI::base().'components/com_adalogin/index.php'; // $redirectURI = JURI::base().'ssologin/index.php'; uncomment this line in old ssologin enviroment // $redirectURI = JURI::base().'adalogin/index.php'; uncomment this line in old adalogin enviroment @@ -60,25 +89,7 @@ public function getLoginURI($redi='') { * @return string */ public function remoteCall($url,$method,$data,$extraHeader='') { - $result = ''; - if ($extraHeader != '') { - $extraHeader .= "\r\n"; - } - $options = array( - 'http' => array( - 'header' => "Content-type: application/x-www-form-urlencoded\r\n".$extraHeader, - 'method'=> $method, - 'content' => http_build_query($data) - ) - ); - if (_UNITTEST == 1) { - global $testData; - $result = $testData->getRemoteResult(); - } else { - $context = stream_context_create($options); - $result = file_get_contents($url, false, $context); - } - return $result; + return $this->interface->remoteCall($url,$method,$data,$extraHeader); } /** @@ -139,8 +150,6 @@ protected function getADAuserData($token) { public function callback() { $input = JFactory::getApplication()->input; $db = JFactory::getDBO(); - $session = JFactory::getSession(); - $token = $this->getADAtoken($input->get('code')); // get user data if (isset($token->access_token)) { @@ -152,6 +161,7 @@ public function callback() { //$this->home = str_replace('https:','http:',$this->home); //uncomment if https: not supported if (isset($userData->userid)) { + $session = JFactory::getSession(); echo '

ADA login client ...

@@ -167,19 +177,17 @@ public function callback() { diff --git a/adalogin/site/models/adalogin.php b/adalogin/site/models/adalogin.php index 0537b9b..6aa7210 100644 --- a/adalogin/site/models/adalogin.php +++ b/adalogin/site/models/adalogin.php @@ -125,7 +125,20 @@ public function loginToJoomla($adaid, $adaemail) { $result = JFactory::getApplication()->login($credentials); if ($result == false) $this->setError('Error in Joomla login'); return $result; - } - + } + /** + * user assurance tárolása a joomla adatbázisba + * @param JUser + * @param string assurance + * return void + */ + public function setUserAssurances($user, $assurance) { + if (is_object($user)) { + if ($assurance != $user->getParam('ASSURANCE')) { + $user->setParam('ASSURANCE',$assurance); + $user->save(); + } + } + } } ?> \ No newline at end of file diff --git a/adalogin/site/views/adalogin/tmpl/logoutform.php b/adalogin/site/views/adalogin/tmpl/logoutform.php new file mode 100644 index 0000000..6fedef9 --- /dev/null +++ b/adalogin/site/views/adalogin/tmpl/logoutform.php @@ -0,0 +1,13 @@ +
+'.JText::_('ADALOGIN_LOGOUT_TITLE').''. + '

'.JText::_('ADALOGIN_LOGOUT_MESSAGE').'

'. + ''. + ''. + ''. + ''. + ''. + ''; +?> +
diff --git a/deploy.bat b/deploy.bat new file mode 100644 index 0000000..0165e03 --- /dev/null +++ b/deploy.bat @@ -0,0 +1,19 @@ +REM git to remote web server +@echo on +delete winscp.log +"C:\Program Files (x86)\WinSCP\WinSCP.com" /script=winscp.scr /log=winscp.log + + + + + + + + + + + + + + + diff --git a/git2www.bat b/git2www.bat new file mode 100644 index 0000000..92a49ab --- /dev/null +++ b/git2www.bat @@ -0,0 +1,40 @@ +@echo on +SET repo=e:\github-repok\Joomla_oauth_plugin\adalogin +SET www=e:\www\elovalasztok + +xcopy %repo%\site\assets %www%\components\com_adalogin\assets /Y /S /E +xcopy %repo%\site\controllers %www%\components\com_adalogin\controllers /Y /S /E +xcopy %repo%\site\helpers %www%\components\com_adalogin\helpers /Y /S /E +xcopy %repo%\site\models %www%\components\com_adalogin\models /Y /S /E +xcopy %repo%\site\views %www%\components\com_adalogin\views /Y /S /E +copy %repo%\site\*.php %www%\components\com_adalogin +copy %repo%\site\*.html %www%\components\com_adalogin + +copy %repo%\site\language\en-GB.com_adalogin.ini %www%\language\en-GB +copy %repo%\site\language\hu-HU.com_adalogin.ini %www%\language\hu-HU + +xcopy %repo%\admin\assets %www%\administrator\components\com_adalogin\assets /Y /S /E +xcopy %repo%\admin\controllers %www%\administrator\components\com_adalogin\controllers /Y /S /E +xcopy %repo%\admin\helpers %www%\administrator\components\com_adalogin\helpers /Y /S /E +xcopy %repo%\admin\models %www%\administrator\components\com_adalogin\models /Y /S /E +xcopy %repo%\admin\sql %www%\administrator\components\com_adalogin\sql /Y /S /E +xcopy %repo%\admin\tables %www%\administrator\components\com_adalogin\tables /Y /S /E +xcopy %repo%\admin\views %www%\administrator\components\com_adalogin\views /Y /S /E +copy %repo%\admin\*.php %www%\administrator\components\com_adalogin +copy %repo%\admin\*.html %www%\administrator\components\com_adalogin +copy %repo%\*.xml %www%\administrator\components\com_adalogin + +copy %repo%\admin\language\en-GB.com_adalogin.ini %www%\administrator\language\en-GB +copy %repo%\admin\language\hu-HU.com_adalogin.ini %www%\administrator\language\hu-HU + + + + + + + + + + + + diff --git a/www2git.bat b/www2git.bat new file mode 100644 index 0000000..2572087 --- /dev/null +++ b/www2git.bat @@ -0,0 +1,23 @@ +@echo on +SET repo=e:\github-repok\Joomla_oauth_plugin\adalogin +SET www=e:\www\elovalasztok + +COPY %www%\administrator\components\com_adalogin\*.xml %repo% +XCOPY %www%\components\com_adalogin %repo%\site /Y /S /E +XCOPY %www%\administrator\components\com_adalogin %repo%\admin /Y /S /E + +COPY %www%\language\en-GB\en-GB.com_adalogin.ini %repo%\site\langauge +COPY %www%\language\hu-HU\hu-HU.com_adalogin.ini %repo%\site\langauge + +COPY %www%\administrator\language\en-GB\en-GB.com_adalogin.ini %repo%\admin\langauge +COPY %www%\administrator\language\hu-HU\hu-HU.com_adalogin.ini %repo%\admin\langauge +COPY %www%\administrator\language\en-GB\en-GB.com_adalogin.sys.ini %repo%\admin\langauge +COPY %www%\administrator\language\hu-HU\hu-HU.com_adalogin.sys.ini %repo%\admin\langauge + + + + + + + +