예제 #1
0
	public function toFormat( $format='%Y-%m-%d %H:%M:%S' )
	{
		if( Komento::joomlaVersion() >= '3.0' )
		{
			if( JString::stristr( $format, '%' ) !== false )
			{
				Komento::import( 'helper', 'date' );
				$format = KomentoDateHelper::strftimeToDate( $format );
			}

			return $this->date->format( $format, true );
		}
		else
		{
			// There is no way to have cross version working, except for detecting % in the format
			if( JString::stristr( $format , '%' ) === false )
			{
				if( Komento::isJoomla15() )
				{
					// forced fallback for Joomla 15 if format doesn't have %
					$format = '%c';
				}
				else
				{
					return $this->date->format( $format , true );
				}

			}

			return $this->date->toFormat( $format, true );
		}
	}
예제 #2
0
	public function send( $max = 5 )
	{
		$konfig		= Komento::getKonfig();

		if( $konfig->get( 'disable_mailq' ) )
		{
			return false;
		}

		$db			= Komento::getDBO();
		$config		= Komento::getConfig();

		$sql = Komento::getSql();

		$sql->select( '#__komento_mailq' )
			->column( 'id' )
			->where( 'status', 0 )
			->order( 'created' )
			->limit( $max );

		$result = $sql->loadObjectList();

		if(! empty($result))
		{
			foreach($result as $mail)
			{
				$mailq	= Komento::getTable('mailq');
				$mailq->load($mail->id);

				$sendHTML = $mailq->type == 'html' ? 1 : 0;

				$state = 0;

				if( empty( $mailq->recipient ) )
				{
					$state = 1;
				}

				//send emails.
				if( Komento::isJoomla15() )
				{
					$state = JUtility::sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
				}
				else
				{
					$mail = JFactory::getMailer();
					$state = $mail->sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
				}

				if( $state )
				{
					// update the status to 1 == proccessed
					$mailq->status  = 1;
					$mailq->store();
				}
			}
		}
	}
예제 #3
0
 public static function getUsergroups()
 {
     $sql = Komento::getSql();
     if (Komento::isJoomla15()) {
         $sql->select('#__core_acl_aro_groups')->column('id')->column('name', 'title')->column('0', 'depth', '', true)->where('(')->where('id', '17', '>')->where('id', '26', '<')->where(')')->where('id', '29', '=', 'or')->order('lft');
     } else {
         $query = "SELECT `x`.*, COUNT(`y`.`id`) - 1 AS `depth` FROM `#__usergroups` AS `x` INNER JOIN `#__usergroups` AS `y` ON `x`.`lft` BETWEEN `y`.`lft` AND `y`.`rgt` GROUP BY `x`.`id` ORDER BY `x`.`lft`";
         $sql->raw($query);
     }
     return $sql->loadObjectList();
 }
예제 #4
0
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Restricted access');
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'toolbar.php';
$submenus = array('komento' => JText::_('COM_KOMENTO_TAB_HOME'), 'system' => JText::_('COM_KOMENTO_TAB_SYSTEM'), 'integrations' => JText::_('COM_KOMENTO_TAB_INTEGRATIONS'), 'comments' => JText::_('COM_KOMENTO_TAB_COMMENTS'), 'pending' => JText::_('COM_KOMENTO_TAB_PENDINGS'), 'reports' => JText::_('COM_KOMENTO_TAB_REPORTS'), 'subscribers' => JText::_('COM_KOMENTO_TAB_SUBSCRIBERS'), 'acl' => JText::_('COM_KOMENTO_TAB_ACL'), 'migrators' => JText::_('COM_KOMENTO_TAB_MIGRATORS'), 'mailq' => JText::_('COM_KOMENTO_TAB_MAILQ'));
$current = JRequest::getVar('view', 'komento');
$user = JFactory::getUser();
// @task: For the frontpage, we just show the the icons.
if ($current == 'komento') {
    $submenus = array('komento' => JText::_('COM_KOMENTO_TAB_HOME'));
}
foreach ($submenus as $view => $title) {
    // Check submenus to add based on JACL
    if (!Komento::isJoomla15()) {
        $jacl = $current === 'komento' ? 'core.manage' : 'komento.manage.' . $view;
        if (!$user->authorise($jacl, 'com_komento')) {
            continue;
        }
    }
    $isActive = $current == $view;
    $notification = '';
    $count = 0;
    switch ($view) {
        case 'pendings':
            $count = Komento::getModel('comments')->getCount('all', 'all', array('published' => 2));
            break;
        case 'reports':
            $count = Komento::getModel('reports', true)->getTotal();
            break;
예제 #5
0
			</li>
		</ul>
		<div class="kmt-login-body">
			<div class="float-r">
				<button type="submit" class="input button kmt-login-button"><?php echo JText::_( 'COM_KOMENTO_LOGIN_BUTTON' ); ?></button>
			</div>
			<div class="float-r">
				<?php if( JPluginHelper::isEnabled( 'system', 'remember' ) ) { ?>
				<label for="remember">
					<input id="remember" type="checkbox" name="remember" value="yes" alt="<?php echo JText::_( 'COM_KOMENTO_LOGIN_REMEMBER_ME' ); ?>" />
					<span><?php echo JText::_( 'COM_KOMENTO_LOGIN_REMEMBER_ME' ); ?></span>
				</label>
				<?php } ?>
			</div>
		</div>
		<?php if( Komento::isJoomla15() ){ ?>
		<input type="hidden" value="com_user"  name="option">
		<input type="hidden" value="login" name="task">
		<input type="hidden" name="return" value="<?php echo base64_encode( JRequest::getURI() ); ?>" />
		<?php } else { ?>
		<input type="hidden" value="com_users"  name="option">
		<input type="hidden" value="user.login" name="task">
		<input type="hidden" name="return" value="<?php echo base64_encode( JRequest::getURI() ); ?>" />
		<?php } ?>
		<?php echo JHTML::_( 'form.token' ); ?>
	</form>

	<div class="kmt-login-footer">
		<a href="<?php echo Komento::getHelper( 'login' )->getRegistrationLink(); ?>" class="kmt-login-link link-register"><i></i><?php echo JText::_( 'COM_KOMENTO_LOGIN_REGISTER' ); ?></a>
		<a href="<?php echo Komento::getHelper( 'login' )->getResetPasswordLink(); ?>" class="kmt-login-link link-forgot"><i></i><?php echo JText::_( 'COM_KOMENTO_LOGIN_FORGOT_PASSWORD' ); ?></a>
	</div>
예제 #6
0
 public function getContext()
 {
     if (Komento::isJoomla15()) {
         return true;
     }
     // Entry view's context is definitely com_content.article
     if ($this->isEntryView()) {
         return 'com_tz_portfolio.comment';
     }
     // Due to a change in the latest Joomla (Joomla 2.5.14 and Joomla 3.1.5)
     // The context in listing pages is no longer com_content.article
     // Return array with all 3 context here to support prior Joomla version, as well as the latest Joomla version
     if ($this->isListingView()) {
         return array('com_tz_portfolio.article', 'com_tz_portfolio.category', 'com_tz_portfolio.featured');
     }
     return false;
 }
예제 #7
0
	public function getRemindUsernameLink()
	{
		$config 	= Komento::getConfig();

		$link = JRoute::_( 'index.php?option=com_users&view=remind' );

		switch( $config->get( 'login_provider' ) )
		{
			case 'easysocial':
				$es = Komento::getHelper( 'EasySocial' );

				if( $es->exists() )
				{
					$link = FRoute::profile( array( 'layout' => 'forgetPassword' ) );
				}
			break;

			default:

				if( Komento::isJoomla15() )
				{
					$link	= JRoute::_( 'index.php?option=com_user&view=remind' );
				}
				else
				{
					$link	= JRoute::_( 'index.php?option=com_users&view=remind' );
				}

			break;
		}

		return $link;
	}
예제 #8
0
 public function getContext()
 {
     return Komento::isJoomla15() ? true : 'com_content.article';
 }