Exemplo n.º 1
0
    function showHelpRegister()
    {
        global $m, $mybasedir;
        $canDo = JFUHelper::getActions();
        $language = JFactory::getLanguage();
        $lang = $language->getTag() == 'de-DE' ? 'de_DE' : 'en_US';
        echo '

<style>
.install {
	margin-left: 5px;
	margin-right: 5px;
	margin-top: 10px;
	margin-bottom: 10px;
	padding: 10px;
	text-align:left;
	border: 1px solid #cccccc;
	width:720px;
	background: #F1F1F1;
}

.h3_help {
text-align:left;
border-bottom: 2px solid #DDDDDD;
}
</style>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<h2>' . JText::_('H_TITLE') . '</h2>

	<!-- Facebook like button -->	  
  <p>	 
  <div id="fb-root"></div>
  <script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/' . $lang . '/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, \'script\', \'facebook-jssdk\'));</script>
 <div class="fb-like-box" data-href="http://www.facebook.com/tinywebgallery" data-width="700" data-border-color="white" data-show-faces="false" data-stream="true" data-header="false"></div>
	</p>
	<!-- end Facebook like button -->	

	<h3 class="h3_help">' . JText::_('H_H3_HELP') . '</h3> 
	' . JText::_('H_H_TEXT') . '
	<div style="text-align:left;float:left;">
	<ul>
		<li>' . JText::_('H_H_OVERVIEW') . '</li>
		<li>' . JText::_('H_H_HELP') . '</li>
		<li>' . JText::_('H_H_TWG') . '</li>
		<li>' . JText::_('H_H_FORUM') . '</li>
		<li>' . JText::_('H_H_CONFIG') . '</li>
		<li>' . JText::_('H_H_MAMBOT') . '</li>
		<li>' . JText::_('H_H_REG') . '</li>
	</ul>
	</div>
    <h3 class="h3_help">' . JText::_('H_L_TITLE') . '</h3>
	  <div style="text-align:left;float:left;">	
	  ' . JText::_('H_L_TEXT') . '   
	  <div class="install" style="width:600px;margin-left:50px;">
	  <b>' . JText::_('H_L_INFOS') . '</b><p> 
';
        $limit = return_kbytes(ini_get('memory_limit'));
        echo JText::_('H_L_NAME') . " " . $_SERVER['SERVER_NAME'] . "<br>";
        echo JText::_('H_L_LIMIT') . " " . getMaximumUploadSize() . "<br>";
        echo JText::_('H_L_MEMORY') . " " . $limit . " <br>";
        echo JText::_('H_L_RESOLUTION') . " ";
        if (!$limit) {
            echo '<font color="green">No limit</font>';
        } else {
            $xy = $limit * 1024 / 6.6;
            $x = floor(sqrt($xy / 0.75));
            $y = floor(sqrt($xy / 1.33));
            if ($x > 4000) {
                echo "<font color='green'>~ " . $x . " x " . $y . "</font>";
            } else {
                if ($x > 2000) {
                    echo "<font color='orange'>~ " . $x . " x " . $y . "</font>";
                } else {
                    echo "<font color='red'>~ " . $x . " x " . $y . "</font>";
                }
            }
        }
        echo "<br>";
        echo JText::_('H_L_INPUT') . " " . ini_get('max_input_time') . " s<br>";
        echo JText::_('H_L_EXECUT') . " " . ini_get('max_execution_time') . " s<br>";
        echo JText::_('H_L_SOCKET') . " " . ini_get('default_socket_timeout') . " s";
        if ($canDo->get('core.admin')) {
            if (substr(@php_uname(), 0, 7) != "Windows") {
                echo '<p>' . JText::_('H_L_CHMOD1') . ' ' . substr(sprintf('%o', @fileperms(dirname(__FILE__) . "/tfu/tfu_config.php")), -4);
                echo '<br>' . JText::_('H_L_CHMOD2');
                echo '</p><p>
        <button onclick="this.form.task.value=\'chmod755\';this.form.submit();">' . JText::_('H_L_CHMOD755') . '</button> 
        <button onclick="this.form.task.value=\'chmod644\';this.form.submit();">' . JText::_('H_L_CHMOD644') . '</button> 
        <button onclick="this.form.task.value=\'chmod666\';this.form.submit();">' . JText::_('H_L_CHMOD666') . '</button> 
        <button onclick="this.form.task.value=\'chmod777\';this.form.submit();">' . JText::_('H_L_CHMOD777') . '</button> 
        </p>
        ';
            }
        } else {
            echo '<p>' . JText::_('ACL_MANAGE_NEEDED') . '</p>';
        }
        echo '
	  </p>
	  </div>
	</div>
	
	<h3 class="h3_help">' . JText::_('H_R_TITLE') . '</h3>';
        if ($canDo->get('core.admin')) {
            echo '	
	<div style="text-align:left;float:left;">
';
            if ($m == "") {
                echo JText::_('H_R_TEXT') . '<ul>
  <li>' . JText::_('H_R_FREEWARE') . '</li
  <li>' . JText::_('H_R_REG') . '</li></ul>
	  <div class="install" style="width:600px;margin-left:50px;">' . JText::_('H_R_BONUS') . '</div>';
                printf(JText::_('H_R_REG_10'), "<a href=\"http://www.tinywebgallery.com/en/register_tfu.php\"><b>", "</b></a>");
                echo '<p>' . JText::_('H_R_REG_HOWTO') . '</p>
<div class="install" style="width:600px;margin-left:50px;">
&lt;?php
<table><tr><td>
$l</td><td>=" <input type="text" name="l" size=100> ";</td></tr><tr><td>
$d</td><td>=" <input type="text" name="d" size=100> ";</td></tr><tr><td>
$s</td><td>=" <input type="text" name="s" size=100> ";</td></tr></table>
?&gt;
<p>
<input type="hidden" name="task" value="register" />
<button onclick="this.form.submit();">' . JText::_('H_R_REGISTER') . '</button>
</p>
</div>
';
            } else {
                if ($m != "" && $m != "s" && $m != "w") {
                    include dirname(__FILE__) . '/' . $mybasedir . "tfu/twg.lic.php";
                    echo JText::_('H_R_REG_TO') . " <b>{$l}</b>";
                    if ($l == $d) {
                        echo " (Enterprise Edition License)";
                    } else {
                        if (strpos($d, "TWG_PROFESSIONAL") !== false) {
                            echo " (Professional Edition License)";
                        } else {
                            if (strpos($d, "TWG_SOURCE") !== false) {
                                echo " (Source code Edition License)";
                            } else {
                                echo " (Standart Edition License)";
                            }
                        }
                    }
                    echo "<p>" . JText::_('H_R_REG_DEL');
                    echo '
<input type="hidden" name="task" value="dellic" />
<button onclick="this.form.submit();">' . JText::_('H_R_UNREGISTER') . '</button>
</p>';
                } else {
                    echo "<p>" . JText::_('H_R_REG_WRONG');
                    echo '
<input type="hidden" name="task" value="dellic" />
<button onclick="this.form.submit();">' . JText::_('H_R_UNREGISTER') . '</button>
</p>';
                }
            }
            echo <<<HTML
</div>
\t      <input type="hidden" name="option" value="com_jfuploader"/>
\t      <input type="hidden" name="boxchecked" value="0" /> 
HTML;
        } else {
            echo JText::_('ACL_MANAGE_NEEDED');
        }
        echo '
	<div style="clear:both;"></div>	
  <h3 class="h3_help">' . JText::_('E_LOG_HEADER') . '</h3>';
        if ($canDo->get('core.admin')) {
            echo '
	  <div style="text-align:left;float:left;">
	  ' . JText::_('E_LOG_INTRO') . '  
	  </div> 
	 <div style="clear:both;"></div>	
   <p> 
	 <div class="logcontainer">';
            $debugfile = dirname(__FILE__) . '/' . $mybasedir . "tfu/tfu.log";
            if (file_exists($debugfile)) {
                $data = file_get_contents($debugfile);
                echo str_replace("\n", '<br>', $data);
            } else {
                echo 'No debug found';
            }
            echo '
	 </div>
	 </p>
   <p>&nbsp;<br>
	 <a class="jfu_button" href="#deletelog" onclick="return submitform(\'deletelog\')">
	 ' . JText::_('E_LOG_BUTTON') . ' 
	 </a>
   <p>';
        } else {
            echo JText::_('ACL_MANAGE_NEEDED');
        }
        echo '   
</form> 
';
    }
 function _CONFIG()
 {
     $canDo = JFUHelper::getActions();
     JToolBarHelper::title('JFUploader', 'jfu_toolbar_title');
     if ($canDo->get('core.manage')) {
         JToolBarHelper::custom('upload', 'upload', 'upload', T_UPLOAD, false);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.edit.state') && $canDo->get('core.admin')) {
         JToolBarHelper::custom('user', 'user', 'user', T_USER, false);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::custom('plugins', 'plugins', 'plugins', T_PLUGINS, false);
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('newConfig');
         }
         if ($canDo->get('core.edit')) {
             JToolBarHelper::editList('edit');
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::custom('copyConfig', 'copy', 'copy', T_COPY, false);
         }
         if ($canDo->get('core.manage')) {
             JToolBarHelper::save('saveMainConfig');
         }
         if ($canDo->get('core.delete')) {
             JToolBarHelper::deleteList('', 'deleteConfig');
         }
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_jfuploader', '550', '850', JACTION_ADMIN_JFU_PERMISSIONS);
         JToolBarHelper::divider();
     }
     JToolBarHelper::help('tfu', true);
 }
Exemplo n.º 3
0
function checkAccess($database, $needed_right)
{
    $canDo = JFUHelper::getActions();
    return $canDo->get($needed_right);
}