first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1,110 @@
<?php
/**
* @version $Id: default.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
$document = JFactory::getDocument();
$document->addScriptDeclaration("
\$K2(document).ready(function(){
\$K2('#K2ImportUsersButton').click(function(event){
var answer = confirm('".JText::_('K2_WARNING_YOU_ARE_ABOUT_TO_IMPORT_JOOMLA_USERS_TO_K2_GENERATING_CORRESPONDING_K2_USER_GROUPS_IF_YOU_HAVE_EXECUTED_THIS_OPERATION_BEFORE_DUPLICATE_CONTENT_MAY_BE_PRODUCED', true)."');
if (!answer){
event.preventDefault();
}
});
});
");
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<table class="k2AdminTableFilters table">
<tr>
<td class="k2AdminTableFiltersSearch">
<?php echo JText::_('K2_FILTER'); ?>
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>" />
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
</td>
<td class="k2AdminTableFiltersSelects hidden-phone">
<?php echo $this->lists['filter_group_k2']; ?>
<?php echo $this->lists['filter_group']; ?>
<?php echo $this->lists['status']; ?>
</td>
</tr>
</table>
<table class="adminlist table table-striped">
<thead>
<tr>
<th class="hidden-phone">#</th>
<th><input id="jToggler" type="checkbox" name="toggle" value="" /></th>
<th><?php echo JHTML::_('grid.sort', 'K2_NAME', 'juser.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_USERNAME', 'juser.username', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="center"><?php echo JText::_('K2_LOGGED_IN'); ?></th>
<th class="center"><?php echo JHTML::_('grid.sort', 'K2_ENABLED', 'juser.block', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_JOOMLA_GROUP', 'juser.usertype', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_GROUP', 'groupname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th><?php echo JHTML::_('grid.sort', 'K2_EMAIL', 'juser.email', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_LAST_VISIT', 'juser.lastvisitDate', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
<th class="center hidden-phone"><?php echo JText::_('K2_LAST_RECORDED_IP'); ?></th>
<th class="center"><?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?></th>
<th class="center hidden-phone"><?php echo JHTML::_('grid.sort', 'K2_ID', 'juser.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="13">
<?php if(K2_JVERSION == '30'): ?>
<div class="k2LimitBox">
<?php echo $this->page->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php echo $this->page->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach ($this->rows as $key => $row): ?>
<tr class="row<?php echo ($key%2); ?>">
<td class="hidden-phone"><?php echo $key+1; ?></td>
<td class="k2Center"><?php $row->checked_out = 0; echo JHTML::_('grid.id', $key, $row->id ); ?></td>
<td><a href="<?php echo $row->link; ?>"><?php echo $row->name; ?></a></td>
<td class="hidden-phone"><?php echo $row->username; ?></td>
<td class="k2Center center"><?php echo $row->loggedInStatus; ?></td>
<td class="k2Center center"><?php echo $row->blockStatus; ?></td>
<td class="hidden-phone"><?php echo $row->usertype; ?></td>
<td class="hidden-phone"><?php echo $row->groupname; ?></td>
<td><?php echo $row->email; ?></td>
<td class="k2Date hidden-phone"><?php echo ($row->lvisit) ? JHTML::_('date', $row->lvisit , $this->dateFormat):JText::_('K2_NEVER'); ?></td>
<td class="k2Center center hidden-phone">
<?php if($row->ip): ?>
<a target="_blank" href="http://www.ipchecking.com/?ip=<?php echo $row->ip; ?>&check=Lookup">
<?php echo $row->ip; ?>
</a>
<?php endif; ?>
</td>
<td class="k2Center center">
<?php if(!$row->block): ?>
<a class="k2ReportUserButton k2IsIcon" href="<?php echo JRoute::_('index.php?option=com_k2&view=user&task=report&id='.$row->id); ?>">&times;</a>
<?php endif; ?>
</td>
<td class="center hidden-phone"><?php echo $row->id; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="hidden" name="option" value="com_k2" />
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>

View File

@ -0,0 +1,107 @@
<?php
/**
* @version $Id: element.php 1971 2013-05-01 16:04:17Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<h1><?php echo JText::_('K2_SELECT_USERS'); ?></h1>
<table class="k2AdminTableFilters">
<tr>
<td class="k2AdminTableFiltersSearch">
<?php echo JText::_('K2_FILTER'); ?>
<input type="text" name="search" value="<?php echo $this->lists['search'] ?>" class="text_area" title="<?php echo JText::_('K2_FILTER_BY_NAME'); ?>" />
<button id="k2SubmitButton"><?php echo JText::_('K2_GO'); ?></button>
<button id="k2ResetButton"><?php echo JText::_('K2_RESET'); ?></button>
</td>
<td class="k2AdminTableFiltersSelects hidden-phone">
<?php echo $this->lists['filter_group_k2']; ?> <?php echo $this->lists['filter_group']; ?> <?php echo $this->lists['status']; ?>
</td>
</tr>
</table>
<table class="adminlist table table-striped">
<thead>
<tr>
<th>
<?php echo JText::_('K2_NUM'); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_NAME', 'juser.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_USER_NAME', 'juser.username', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_ENABLED', 'juser.block', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_GROUP', 'juser.usertype', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_K2_GROUP', 'groupname', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th>
<?php echo JHTML::_('grid.sort', 'K2_ID', 'juser.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="7">
<?php if(K2_JVERSION == '30'): ?>
<div class="k2LimitBox">
<?php echo $this->page->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php echo $this->page->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php foreach($this->rows as $key => $row): ?>
<tr class="row<?php echo ($key%2); ?>">
<td class="k2Center">
<?php echo $key+1; ?>
</td>
<td>
<a class="k2ListItemDisabled" title="<?php echo JText::_('K2_CLICK_TO_ADD_THIS_ITEM'); ?>" onclick="window.parent.jSelectUser('<?php echo $row->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$row->name); ?>', 'id');"><?php echo $row->name; ?></a>
</td>
<td class="k2Center">
<?php echo $row->username; ?>
</td>
<td class="k2Center">
<?php echo $row->blockStatus; ?>
</td>
<td class="k2Center">
<?php echo $row->usertype; ?>
</td>
<td class="k2Center">
<?php echo $row->groupname; ?>
</td>
<td class="k2Center">
<?php echo $row->id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<input type="hidden" name="option" value="com_k2" />
<?php if ($this->isAdmin): ?>
<input type="hidden" name="view" value="users" />
<input type="hidden" name="task" value="element" />
<?php else: ?>
<input type="hidden" name="view" value="item" />
<input type="hidden" name="task" value="users" />
<?php endif; ?>
<input type="hidden" name="tmpl" value="component" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
</form>

View File

@ -0,0 +1,39 @@
<?php
/**
* @version $Id: move.php 1877 2013-02-07 14:37:58Z joomlaworks $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<fieldset style="float:left;">
<legend><?php echo JText::_('K2_TARGET_JOOMLA_USER_GROUP'); ?></legend>
<?php echo $this->lists['group']; ?>
</fieldset>
<fieldset style="float:left;">
<legend><?php echo JText::_('K2_TARGET_K2_USER_GROUP'); ?></legend>
<?php echo $this->lists['k2group']; ?>
</fieldset>
<fieldset style="clear:both;">
<legend>(<?php echo count($this->rows); ?>) <?php echo JText::_('K2_USERS_BEING_MOVED'); ?></legend>
<ol>
<?php foreach ($this->rows as $row): ?>
<li>
<?php echo $row->name; ?>
<input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
</li>
<?php endforeach; ?>
</ol>
</fieldset>
<input type="hidden" name="option" value="com_k2" />
<input type="hidden" name="view" value="<?php echo JRequest::getVar('view'); ?>" />
<input type="hidden" name="task" value="<?php echo JRequest::getVar('task'); ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>

View File

@ -0,0 +1,282 @@
<?php
/**
* @version $Id: view.html.php 1978 2013-05-15 19:34:16Z joomlaworks $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die ;
jimport('joomla.application.component.view');
class K2ViewUsers extends K2View
{
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$db = JFactory::getDBO();
$params = JComponentHelper::getParams('com_k2');
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
$limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');
$limitstart = $mainframe->getUserStateFromRequest($option.$view.'.limitstart', 'limitstart', 0, 'int');
$filter_order = $mainframe->getUserStateFromRequest($option.$view.'filter_order', 'filter_order', 'juser.name', 'cmd');
$filter_order_Dir = $mainframe->getUserStateFromRequest($option.$view.'filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_status = $mainframe->getUserStateFromRequest($option.$view.'filter_status', 'filter_status', -1, 'int');
$filter_group = $mainframe->getUserStateFromRequest($option.$view.'filter_group', 'filter_group', '', 'string');
$filter_group_k2 = $mainframe->getUserStateFromRequest($option.$view.'filter_group_k2', 'filter_group_k2', '', 'string');
$search = $mainframe->getUserStateFromRequest($option.$view.'search', 'search', '', 'string');
$search = JString::strtolower($search);
K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'models');
$model = K2Model::getInstance('Users', 'K2Model');
$total = $model->getTotal();
if ($limitstart > $total - $limit)
{
$limitstart = max(0, (int)(ceil($total / $limit) - 1) * $limit);
JRequest::setVar('limitstart', $limitstart);
}
$users = $model->getData();
$task = JRequest::getCmd('task');
for ($i = 0; $i < sizeof($users); $i++)
{
$users[$i]->loggedin = $model->checkLogin($users[$i]->id);
$users[$i]->profileID = $model->hasProfile($users[$i]->id);
if ($users[$i]->profileID)
{
$db->setQuery("SELECT ip FROM #__k2_users WHERE id = ".$users[$i]->profileID);
$users[$i]->ip = $db->loadResult();
}
else
{
$users[$i]->ip = '';
}
if ($users[$i]->lastvisitDate == "0000-00-00 00:00:00")
{
$users[$i]->lvisit = false;
}
else
{
$users[$i]->lvisit = $users[$i]->lastvisitDate;
}
$users[$i]->link = JRoute::_('index.php?option=com_k2&view=user&cid='.$users[$i]->id);
if (K2_JVERSION == '15')
{
$users[$i]->published = $users[$i]->loggedin;
$users[$i]->loggedInStatus = strip_tags(JHTML::_('grid.published', $users[$i], $i), '<img>');
$users[$i]->blockStatus = '';
if ($users[$i]->block)
{
$users[$i]->blockStatus .= '<a title="'.JText::_('K2_ENABLE').'" onclick="return listItemTask(\'cb'.$i.',\'enable\')" href="#"><img alt="'.JText::_('K2_ENABLED').'" src="images/publish_x.png"></a>';
}
else
{
$users[$i]->blockStatus .= '<a title="'.JText::_('K2_DISABLE').'" onclick="return listItemTask(\'cb'.$i.',\'disable\')" href="#"><img alt="'.JText::_('K2_DISABLED').'" src="images/tick.png"></a>';
}
if ($task == 'element')
{
$users[$i]->blockStatus = strip_tags($users[$i]->blockStatus, '<img>');
}
}
else
{
$states = array(1 => array('', 'K2_LOGGED_IN', 'K2_LOGGED_IN', 'K2_LOGGED_IN', false, 'publish', 'publish'), 0 => array('', 'K2_NOT_LOGGED_IN', 'K2_NOT_LOGGED_IN', 'K2_NOT_LOGGED_IN', false, 'unpublish', 'unpublish'), );
$users[$i]->loggedInStatus = JHtml::_('jgrid.state', $states, $users[$i]->loggedin, $i, '', false);
$states = array(
0 => array('disable', 'K2_ENABLED', 'K2_DISABLE', 'K2_ENABLED', false, 'publish', 'publish'),
1 => array('enable', 'K2_DISABLED', 'K2_ENABLE', 'K2_DISABLED', false, 'unpublish', 'unpublish'));
$users[$i]->blockStatus = JHtml::_('jgrid.state', $states, $users[$i]->block, $i, '', $task != 'element');
}
}
$this->assignRef('rows', $users);
jimport('joomla.html.pagination');
$pageNav = new JPagination($total, $limitstart, $limit);
$this->assignRef('page', $pageNav);
$lists = array();
$lists['search'] = $search;
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
$filter_status_options[] = JHTML::_('select.option', -1, JText::_('K2_SELECT_STATE'));
$filter_status_options[] = JHTML::_('select.option', 0, JText::_('K2_ENABLED'));
$filter_status_options[] = JHTML::_('select.option', 1, JText::_('K2_BLOCKED'));
$lists['status'] = JHTML::_('select.genericlist', $filter_status_options, 'filter_status', '', 'value', 'text', $filter_status);
$userGroups = $model->getUserGroups();
$groups[] = JHTML::_('select.option', '0', JText::_('K2_SELECT_JOOMLA_GROUP'));
foreach ($userGroups as $userGroup)
{
$groups[] = JHTML::_('select.option', $userGroup->value, $userGroup->text);
}
$lists['filter_group'] = JHTML::_('select.genericlist', $groups, 'filter_group', '', 'value', 'text', $filter_group);
$K2userGroups = $model->getUserGroups('k2');
$K2groups[] = JHTML::_('select.option', '0', JText::_('K2_SELECT_K2_GROUP'));
foreach ($K2userGroups as $K2userGroup)
{
$K2groups[] = JHTML::_('select.option', $K2userGroup->id, $K2userGroup->name);
}
$lists['filter_group_k2'] = JHTML::_('select.genericlist', $K2groups, 'filter_group_k2', '', 'value', 'text', $filter_group_k2);
$this->assignRef('lists', $lists);
if (K2_JVERSION != '15')
{
$dateFormat = JText::_('K2_J16_DATE_FORMAT');
}
else
{
$dateFormat = JText::_('K2_DATE_FORMAT');
}
$this->assignRef('dateFormat', $dateFormat);
$template = $mainframe->getTemplate();
$this->assignRef('template', $template);
if ($mainframe->isAdmin())
{
JToolBarHelper::title(JText::_('K2_USERS'), 'k2.png');
JToolBarHelper::custom('move', 'move.png', 'move_f2.png', 'K2_MOVE', true);
JToolBarHelper::deleteList('K2_WARNING_YOU_ARE_ABOUT_TO_DELETE_THE_SELECTED_USERS_PERMANENTLY_FROM_THE_SYSTEM', 'delete', 'K2_DELETE');
JToolBarHelper::publishList('enable', 'K2_ENABLE');
JToolBarHelper::unpublishList('disable', 'K2_DISABLE');
JToolBarHelper::editList();
JToolBarHelper::deleteList('K2_ARE_YOU_SURE_YOU_WANT_TO_RESET_SELECTED_USERS', 'remove', 'K2_RESET_USER_DETAILS');
$toolbar = JToolBar::getInstance('toolbar');
if (K2_JVERSION != '15')
{
JToolBarHelper::preferences('com_k2', 550, 875, 'K2_PARAMETERS');
}
else
{
$toolbar->appendButton('Popup', 'config', 'K2_PARAMETERS', 'index.php?option=com_k2&view=settings');
}
$this->loadHelper('html');
K2HelperHTML::subMenu();
$user = JFactory::getUser();
$canImport = false;
if (K2_JVERSION == '15')
{
$canImport = $user->gid > 23;
}
else
{
$canImport = $user->authorise('core.admin', 'com_k2');
}
if ($canImport)
{
if (!$params->get('hideImportButton'))
{
$buttonUrl = JURI::base().'index.php?option=com_k2&amp;view=users&amp;task=import';
$buttonText = JText::_('K2_IMPORT_JOOMLA_USERS');
if (K2_JVERSION == '30')
{
$button = '<a id="K2ImportUsersButton" class="btn btn-small" href="'.$buttonUrl.'"><i class="icon-archive "></i>'.$buttonText.'</a>';
}
else
{
$button = '<a id="K2ImportUsersButton" href="'.$buttonUrl.'"><span class="icon-32-archive" title="'.$buttonText.'"></span>'.$buttonText.'</a>';
}
$toolbar->appendButton('Custom', $button);
}
}
$document = JFactory::getDocument();
$document->addScriptDeclaration('var K2Language = ["'.JText::_('K2_REPORT_USER_WARNING', true).'"];');
}
$isAdmin = $mainframe->isAdmin();
$this->assignRef('isAdmin', $isAdmin);
if ($mainframe->isSite())
{
// CSS
$document->addStyleSheet(JURI::root(true).'/media/k2/assets/css/k2.frontend.css?v=2.6.7');
$document->addStyleSheet(JURI::root(true).'/templates/system/css/general.css');
$document->addStyleSheet(JURI::root(true).'/templates/system/css/system.css');
if (K2_JVERSION != '15')
{
$document->addStyleSheet(JURI::root(true).'/administrator/templates/bluestork/css/template.css');
$document->addStyleSheet(JURI::root(true).'/media/system/css/system.css');
}
else
{
$document->addStyleSheet(JURI::root(true).'/administrator/templates/khepri/css/general.css');
}
}
parent::display($tpl);
}
function move()
{
$mainframe = JFactory::getApplication();
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
$cid = JRequest::getVar('cid');
JArrayHelper::toInteger($cid);
foreach ($cid as $id)
{
$row = JFactory::getUser($id);
$rows[] = $row;
}
$this->assignRef('rows', $rows);
$model = $this->getModel('users');
$lists = array();
$userGroups = $model->getUserGroups();
$groups[] = JHTML::_('select.option', '', JText::_('K2_DO_NOT_CHANGE'));
foreach ($userGroups as $userGroup)
{
$groups[] = JHTML::_('select.option', $userGroup->value, JText::_($userGroup->text));
}
$fieldName = 'group';
$attributes = 'size="10"';
if (K2_JVERSION != '15')
{
$attributes .= 'multiple="multiple"';
$fieldName .= '[]';
}
$lists['group'] = JHTML::_('select.genericlist', $groups, $fieldName, $attributes, 'value', 'text', '');
$K2userGroups = $model->getUserGroups('k2');
$K2groups[] = JHTML::_('select.option', '0', JText::_('K2_DO_NOT_CHANGE'));
foreach ($K2userGroups as $K2userGroup)
{
$K2groups[] = JHTML::_('select.option', $K2userGroup->id, $K2userGroup->name);
}
$lists['k2group'] = JHTML::_('select.genericlist', $K2groups, 'k2group', 'size="10"', 'value', 'text', 0);
$this->assignRef('lists', $lists);
JToolBarHelper::title(JText::_('K2_MOVE_USERS'), 'k2.png');
JToolBarHelper::custom('saveMove', 'save.png', 'save_f2.png', 'K2_SAVE', false);
JToolBarHelper::cancel();
parent::display();
}
}