Example #1
0
 public function testGetters()
 {
     $reflection = new ReflectionObject($this->page);
     $properties = $reflection->getProperties(ReflectionProperty::IS_PRIVATE | ReflectionProperty::IS_PROTECTED);
     foreach ($properties as $property) {
         $propertyName = $property->getName();
         $propertyGetter = array($this->page, 'get' . UCFirst($propertyName));
         if (!is_callable($propertyGetter)) {
             $this->fail("Entity '" . get_class($this->page) . "' must implement 'get" . UCFirst($propertyName) . "' method");
         }
     }
 }
Example #2
0
 public function __construct($type, $name, $varname, $options = array())
 {
     $this->type = UCFirst(strtolower($type));
     $classType = 'Tigreboite\\FunkylabBundle\\Generator\\Field\\' . $this->type;
     $this->name = $name;
     $this->varname = $varname;
     if (class_exists($classType)) {
         $this->field = new $classType($this->varname, $this->name, $options);
     } else {
         $this->field = new Base($this->varname, $this->name, $options);
     }
 }
 static function getController(Request $request)
 {
     $controller = $request->get('controller') == null ? App::get('default_controller') : $request->get('controller');
     if (!preg_match('/\\W/', $controller)) {
         if (!empty($controller)) {
             $controller = UCFirst(strtolower($controller)) . 'Controller';
             $ds = DIRECTORY_SEPARATOR;
             $basePath = self::$dirToController . $ds . $controller . '.php';
             if (file_exists($basePath)) {
                 require_once $basePath;
                 return new $controller($request);
             }
         }
     }
     throw new Exception("Контроллер {$controller} не найден");
 }
Example #4
0
 static function getCommand($action = 'Default')
 {
     if (preg_match('/\\W/', $action)) {
         throw new Exception("Недопустимые символы в команде");
     }
     $class = UCFirst(strtolower($action)) . "Command";
     $file = self::$dir . DIRECTORY_SEPARATOR . "{$class}.php";
     if (!file_exists($file)) {
         throw new CommandNotFoundException("Файл '{$file}' не найден");
     }
     require_once $file;
     if (!class_exists($class)) {
         throw new CommandNotFoundException("Класс '{$class}' необнаружен");
     }
     $cmd = new $class();
     return $cmd;
 }
Example #5
0
 static function getCommand($action = 'Default')
 {
     if (preg_match('/\\W/', $action)) {
         throw new Exception("illegal characters in action");
     }
     $class = UCFirst(strtolower($action)) . "Command";
     $file = self::$dir . DIRECTORY_SEPARATOR . "{$class}.php";
     if (!file_exists($file)) {
         throw new CommandNotFoundException("could not find '{$file}'");
     }
     require_once $file;
     if (!class_exists($class)) {
         throw new CommandNotFoundException("no '{$class}' class located");
     }
     $cmd = new $class();
     return $cmd;
 }
Example #6
0
 protected function getData($entity)
 {
     $reflection = new ReflectionObject($entity);
     $properties = $reflection->getProperties(ReflectionProperty::IS_PRIVATE | ReflectionProperty::IS_PROTECTED);
     $data = array();
     foreach ($properties as $property) {
         $propertyName = $property->getName();
         $propertyGetter = array($entity, 'get' . UCFirst($propertyName));
         if (!is_callable($propertyGetter)) {
             throw new RuntimeException("Entity '" . get_class($entity) . "' must implement 'get" . UCFirst($propertyName) . "' method");
         }
         $propertyValue = call_user_func($propertyGetter);
         if ($propertyValue != null) {
             $data[$propertyName] = $propertyValue;
         }
     }
     return $data;
 }
 public function __construct($entity, $bundle, $type)
 {
     $type = UCFirst(strtolower($type));
     $this->bundle = $bundle;
     $this->entityName = explode('\\', $entity);
     $this->entityName = end($this->entityName);
     $path = explode('vendor', dirname(__FILE__));
     $path = $path[0] . "src/" . $bundle . "/";
     $this->files = array();
     $className = 'Tigreboite\\FunkylabBundle\\Generator\\' . $type . 'Formater';
     if (class_exists($className)) {
         $formater = new $className($bundle, $entity);
         //Process Controller
         $code_controller = $formater->getController($type);
         $filename = $path . "Controller/" . $this->entityName . "Controller.php";
         file_put_contents($filename, $code_controller);
         $this->addFile($filename);
         //Process EntityType
         $code_type = $formater->getFormType($type);
         if (!is_dir($path . "Form")) {
             mkdir($path . "Form");
         }
         $filename = $path . "Form/" . $this->entityName . "Type.php";
         file_put_contents($filename, $code_type);
         $this->addFile($filename);
         //Process Views
         $code_views = $formater->getViews($type);
         if (is_array($code_views)) {
             foreach ($code_views as $filename => $body) {
                 if (!is_dir($path . "Resources/views/" . $this->entityName)) {
                     mkdir($path . "Resources/views/" . $this->entityName);
                 }
                 file_put_contents($path . "Resources/views/" . $this->entityName . "/" . $filename, $body);
                 $this->addFile($path . "Resources/views/" . $this->entityName . "/" . $filename);
             }
         }
     } else {
         throw new \RuntimeException($type . " format doesn't exist");
     }
 }
?>
:
                                </td>
                                <td>
                                    <a class="link btn-free" href="#" onClick="display(); return false;">
                                        <?php 
$speed = 0;
if (SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED > 0) {
    $speed = SITE_CONFIG_FREE_USER_MAX_DOWNLOAD_SPEED;
}
echo calculateDownloadSpeedFormatted($file->fileSize, $speed);
?>
                                    </a>
                                    <div class="download-timer" style="display:none;">
                                        <?php 
echo UCFirst(t('wait', 'wait'));
?>
 <span class="download-timer-seconds"></span>&nbsp;<?php 
echo t('sec', 'sec');
?>
.                                
                                    </div>
                                </td>
                                <td>
                                    <a class="link premiumBtn" href="<?php 
echo $url;
?>
">
                                        <?php 
echo calculateDownloadSpeedFormatted($file->fileSize, 0);
?>
Example #9
0
function load_prefs()
{
    global $userfolder, $sess, $default_preferences;
    extract($default_preferences);
    $pref_file = $userfolder . "_infos/prefs.upf";
    if (!file_exists($pref_file)) {
        $prefs["real-name"] = UCFirst(substr($sess["email"], 0, strpos($sess["email"], "@")));
        $prefs["reply-to"] = $sess["email"];
        $prefs["save-to-trash"] = $send_to_trash_default;
        $prefs["st-only-read"] = $st_only_ready_default;
        $prefs["empty-trash"] = $empty_trash_default;
        $prefs["save-to-sent"] = $save_to_sent_default;
        $prefs["sort-by"] = $sortby_default;
        $prefs["sort-order"] = $sortorder_default;
        $prefs["rpp"] = $rpp_default;
        $prefs["add-sig"] = $add_signature_default;
        $prefs["signature"] = $signature_default;
        $prefs["timezone"] = $timezone_default;
        $prefs["display-images"] = $display_images_default;
        $prefs["editor-mode"] = $editor_mode_default;
        $prefs["refresh-time"] = $refresh_time_default;
    } else {
        $prefs = file($pref_file);
        $prefs = join("", $prefs);
        $prefs = unserialize(~$prefs);
    }
    return $prefs;
}
Example #10
0
 /**
  * 	Выводит лог
  * 	@param	bool	$html   Выводить в виде html (иначе в виде массива) 
  *                          [SQL_REPORT_ARRAY|SQL_REPORT_HTML]
  * 	@param	bool	$clean	
  *                  Очищать ли лог после вывода [SQL_REPORT_CLEAN]
  * 	@return	mixed
  */
 function logOut($html = SQL_REPORT_HTML, $clean = false)
 {
     $k = 0;
     $array = array();
     $array[] = array("<b>Отчет для MySQL соединения «{$this->_type}».</b>", CMSCONSOLE_NOTICE);
     $array[] = array("Успешное " . ($this->_persistent ? "постоянное" : "обычное") . " подключение к <b>{$this->_base}@{$this->_host}</b>," . "кодировка соединения: <b>{$this->_encoding}</b>.", CMSCONSOLE_NOTICE);
     //$array[] = array("Максимальный размер пакета <small>(max_allowed_packet)</small>: <b>{$this->_maxPacket} байт</b>.", CMSCONSOLE_NOTICE);
     //$array[] = array("<img src='/images/free.gif'>", "");
     //cmsVar($this->_log);
     //for ($i = 0, $im = count($this->_log); $i < $im; $i++) {
     foreach ($this->_log as $i => $logLine) {
         // По-умолчанию считаем, что все ок :)
         $hasErrors = false;
         $hasWarnings = false;
         $hasNotices = false;
         $hasOverrides = false;
         // Первый цикл, выясняем, что внутри
         //if (count($this->_log[$i])) foreach ($this->_log[$i] as $l) {
         if (count($logLine)) {
             foreach ($logLine as $l) {
                 list($type, $msg, $override) = $l;
                 if ($override == SQL_LOG_FORCE) {
                     $hasOverrides = true;
                 }
                 if ($type == SQL_TYPE_WARNING) {
                     $hasWarnings = true;
                 }
                 if ($type == SQL_TYPE_ERROR) {
                     $hasErrors = true;
                 }
                 if ($type == SQL_TYPE_NOTICE) {
                     $hasNotices = true;
                 }
             }
             $out = false;
             // Второй цикл и контроль вывода
             //if (count($this->_log[$i])) foreach ($this->_log[$i] as $l) {
             foreach ($logLine as $l) {
                 list($type, $msg, $override) = $l;
                 $msg = trim($msg);
                 $consoleType = $type == SQL_TYPE_WARNING || $type == SQL_TYPE_ERROR || $type == SQL_TYPE_NOTICE ? $type : "";
                 // ошибки с SQL_LOG_BLOCK до сюда даже не дойдут
                 if ($hasOverrides || $type == SQL_TYPE_NORMAL || ($type == SQL_TYPE_QUERY && array_key_exists(SQL_TYPE_QUERY, $this->_logLevel) || ($hasErrors && array_key_exists(SQL_TYPE_ERROR, $this->_logLevel) || $hasWarnings && array_key_exists(SQL_TYPE_WARNING, $this->_logLevel))) || $type == SQL_TYPE_ERROR && array_key_exists(SQL_TYPE_ERROR, $this->_logLevel) || $type == SQL_TYPE_WARNING && array_key_exists(SQL_TYPE_WARNING, $this->_logLevel) || $type == SQL_TYPE_NOTICE && array_key_exists(SQL_TYPE_NOTICE, $this->_logLevel)) {
                     if ($type == SQL_TYPE_QUERY) {
                         $msg = $this->format($msg);
                     }
                     $cssType = "mysql_{$type}";
                     if ($hasNotices) {
                         $cssType .= " mysql_" . SQL_TYPE_NOTICE;
                     }
                     if ($hasWarnings) {
                         $cssType .= " mysql_" . SQL_TYPE_WARNING;
                     }
                     if ($hasErrors) {
                         $cssType .= " mysql_" . SQL_TYPE_ERROR;
                     }
                     $array[] = array("<pre class='mysql {$cssType}'><b>" . UCFirst($type) . ":</b> {$msg}</pre>", $consoleType);
                     $out = true;
                 }
             }
         }
         //if ($out) $array[] = array("<img src='/images/free.gif'>", "");
     }
     $array[] = array(print_r($this->_logLevel, true), CMSCONSOLE_NOTICE);
     $array[] = array("Запросов: <b>{$this->_queries}</b>," . "Предупреждений: <b>{$this->_warnings}</b>," . "Ошибок: <b>{$this->_errors}</b>.", CMSCONSOLE_NOTICE);
     $array[] = array("<b>Полное время выполнения: <u>" . $this->timeFormat($this->_execTime) . "</u>, запросов:  <u>" . $this->timeFormat($this->_queryTime) . "</u>, разбора данных: <u>" . $this->timeFormat($this->_fetchTime) . "</u>.</b>", CMSCONSOLE_NOTICE);
     if ($clean) {
         $this->_log = array();
     }
     if ($html) {
         ob_start();
         foreach ($array as $a) {
             echo "<div>{$a[0]}</div>";
         }
         return ob_get_clean();
     } else {
         return $array;
     }
 }
 $student_id = $students[1]['STUDENT_ID'];
 if (!$students[1]['STAFF_ID']) {
     if ($_REQUEST['contact'][$student_id]) {
         $tmp_username = $username = trim(mb_strpos($students[1]['EMAIL'], '@') !== false ? mb_substr($students[1]['EMAIL'], 0, mb_strpos($students[1]['EMAIL'], '@')) : $students[1]['EMAIL']);
         $i = 1;
         while (DBGet(DBQuery("SELECT STAFF_ID FROM STAFF WHERE upper(USERNAME)=upper('{$username}') AND SYEAR='" . UserSyear() . "'"))) {
             $username = $tmp_username . $i++;
         }
         $user = DBGet(DBQuery("SELECT FIRST_NAME,MIDDLE_NAME,LAST_NAME FROM PEOPLE WHERE PERSON_ID='" . $_REQUEST['contact'][$student_id] . "'"));
         $user = $user[1];
         //modif Francois: change parent password generation
         //				$password = $passwords[rand(0,count($passwords)-1)];
         $password = $username . rand(100, 999);
         //modif Francois: Moodle integrator / password
         if (MOODLE_INTEGRATOR) {
             $password = UCFirst($password) . '*';
         }
         if (!$test_email) {
             // get staff id
             $id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STAFF_SEQ') . ' AS SEQ_ID ' . FROM_DUAL));
             $id = $id[1]['SEQ_ID'];
             //modif Francois: add password encryption
             $password_encrypted = encrypt_password($password);
             $sql = "INSERT INTO STAFF (STAFF_ID,SYEAR,PROFILE,PROFILE_ID,FIRST_NAME,MIDDLE_NAME,LAST_NAME,USERNAME,PASSWORD,EMAIL) values ('{$id}','" . UserSyear() . "','parent','{$profile_id}','{$user['FIRST_NAME']}','{$user['MIDDLE_NAME']}','{$user['LAST_NAME']}','{$username}','{$password_encrypted}','" . $students[1]['EMAIL'] . "')";
             DBQuery($sql);
             //modif Francois: Moodle integrator
             $moodleError = Moodle($_REQUEST['modname'], 'core_user_create_users');
             $staff = DBGet(DBquery("SELECT FIRST_NAME||' '||LAST_NAME AS NAME,USERNAME,PASSWORD FROM STAFF WHERE STAFF_ID='" . $id . "'"));
         } else {
             $id = true;
             $staff = array(1 => array('NAME' => $user['FIRST_NAME'] . ' ' . $user['LAST_NAME'], 'USERNAME' => $username, 'PASSWORD' => $password));
Example #12
0
File: Text.php Project: nicoes/CMS
	public function text($tag)
	{
		return UCFirst($this->langapp[$tag]);
	}
Example #13
0
function table_grants_header($dbcheck = FALSE)
{
    global $cfgBorder;
    global $strAction;
    global $strHost, $strUser, $strDatabase, $strColumn;
    global $strTable, $strPrivileges;
    echo "<table border={$cfgBorder}>\n<tr>";
    if ($dbcheck) {
        echo "<th>{$strAction}</th>";
        echo "<th>{$strHost}</th>";
        echo "<th>{$strUser}</th>";
    } else {
        echo "<th colspan=2>{$strAction}</td>";
    }
    echo "<th>{$strDatabase}</th>";
    echo "<th>" . UCFirst($strTable) . "</th>";
    echo "<th>{$strPrivileges}</th>";
    if (!$dbcheck) {
        echo "<th>Grant Option</th>";
    }
    echo "</tr>\n";
}
Example #14
0
 function ApplyData($data = null, array $validActions = array('add', 'mod', 'del'))
 {
     if ($data === null) {
         $data = $this->request;
     }
     if (!in_array($data['act'], $validActions)) {
         throw new Exception("Invalid action [{$data['act']}] for ApplyData");
     }
     $funcName = 'do' . UCFirst($data['act']);
     if (is_callable(array($this, $funcName))) {
         return $this->{$funcName}($data);
     } else {
         throw new Exception('Function ' . R3Controller::getObjectType($_REQUEST) . '::' . $funcName . ' not found');
     }
 }
function appendStaffSQL($sql, $extra)
{
    global $_ROSARIO;
    if ($_REQUEST['usrid']) {
        //modif Francois: allow comma separated list of staff IDs
        $usrid_array = explode(',', $_REQUEST['usrid']);
        $usrids = array();
        foreach ($usrid_array as $usrid) {
            if (is_numeric($usrid)) {
                $usrids[] = $usrid;
            }
        }
        if (!empty($usrids)) {
            $usrids = implode(',', $usrids);
            //$sql .= " AND s.STAFF_ID='".$_REQUEST['usrid']."'";
            $sql .= " AND s.STAFF_ID IN (" . $usrids . ")";
            if (!$extra['NoSearchTerms']) {
                $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . Localize('colon', _('User ID')) . ' </b></span>' . $usrids . '<BR />';
            }
        }
    }
    if ($_REQUEST['last']) {
        $sql .= " AND UPPER(s.LAST_NAME) LIKE '" . mb_strtoupper($_REQUEST['last']) . "%'";
        if (!$extra['NoSearchTerms']) {
            $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . Localize('colon', _('Last Name starts with')) . ' </b></span>' . str_replace("''", "'", $_REQUEST['last']) . '<BR />';
        }
    }
    if ($_REQUEST['first']) {
        $sql .= " AND UPPER(s.FIRST_NAME) LIKE '" . mb_strtoupper($_REQUEST['first']) . "%'";
        if (!$extra['NoSearchTerms']) {
            $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . Localize('colon', _('First Name starts with')) . ' </b></span>' . str_replace("''", "'", $_REQUEST['first']) . '<BR />';
        }
    }
    if ($_REQUEST['profile']) {
        $sql .= " AND s.PROFILE='" . $_REQUEST['profile'] . "'";
        if (!$extra['NoSearchTerms']) {
            $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . Localize('colon', _('Profile')) . ' </b></span>' . _(UCFirst($_REQUEST['profile'])) . '<BR />';
        }
    }
    if ($_REQUEST['username']) {
        $sql .= " AND UPPER(s.USERNAME) LIKE '" . mb_strtoupper($_REQUEST['username']) . "%'";
        if (!$extra['NoSearchTerms']) {
            $_ROSARIO['SearchTerms'] .= '<span style="color:gray"><b>' . Localize('colon', _('UserName starts with')) . ' </b></span>' . str_replace("''", "'", $_REQUEST['username']) . '<BR />';
        }
    }
    return $sql;
}
Example #16
0
/**
 * Displays the table of grants for an user
 *
 * @param   mixed    the id of the query used to get hosts and databases lists
 *                   or an arry containing host and user informations
 * @param   mixed    the database to check garnts for, FALSE for all databases
 *
 * @return  boolean  always true
 *
 * @global  string   the current language
 * @global  integer  the server to use (refers to the number in the
 *                   configuration file)
 *
 * @see     PMA_checkDb()
 *
 * @TODO    "SHOW GRANTS" statements is available and buggyless since
 *          MySQL 3.23.4 and it seems not to return privileges of the anonymous
 *          user while these privileges applies to all users.
 */
function PMA_tableGrants(&$host_db_result, $dbcheck = FALSE)
{
    global $lang, $server;
    ?>

<!-- Table of grants -->
<table border="<?php 
    echo $GLOBALS['cfgBorder'];
    ?>
">
<tr>
    <?php 
    // 1. Table headers
    if ($dbcheck) {
        echo "\n";
        echo '    <th>' . $GLOBALS['strAction'] . '</th>' . "\n";
        echo '    <th>' . $GLOBALS['strHost'] . '</th>' . "\n";
        echo '    <th>' . $GLOBALS['strUser'] . '</th>';
    } else {
        echo "\n";
        echo '    <th colspan="2">' . $GLOBALS['strAction'] . '</th>';
    }
    echo "\n";
    echo '    <th>' . $GLOBALS['strDatabase'] . '</th>' . "\n";
    echo '    <th>' . UCFirst($GLOBALS['strTable']) . '</th>' . "\n";
    echo '    <th>' . $GLOBALS['strPrivileges'] . '</th>' . "\n";
    if (!$dbcheck) {
        echo '    <th>Grant Option</th>' . "\n";
    }
    ?>
</tr>
    <?php 
    echo "\n";
    // 2. Table body
    $url_query = 'lang=' . $lang . '&amp;server=' . $server . '&amp;db=mysql&amp;table=user';
    while ($row = is_array($host_db_result) ? $host_db_result : mysql_fetch_array($host_db_result)) {
        $local_query = 'SHOW GRANTS FOR \'' . $row['User'] . '\'@\'' . $row['Host'] . '\'';
        $result = mysql_query($local_query);
        $grants_cnt = @mysql_num_rows($result);
        if ($grants_cnt) {
            $i = 0;
            while ($usr_row = mysql_fetch_row($result)) {
                if (eregi('GRANT (.*) ON ([^.]+).([^.]+) TO .*$', $usr_row[0], $parts)) {
                    // loic1: bug #487673 - revoke 'reference'
                    if ($parts[1] == 'USAGE') {
                        $priv = '';
                    } else {
                        $priv = ereg_replace('REFERENCE([^S]|$)', 'REFERENCES\\1', trim($parts[1]));
                    }
                    $db = $parts[2];
                    $table = trim($parts[3]);
                    $grantopt = eregi('WITH GRANT OPTION$', $usr_row[0]);
                } else {
                    $priv = '';
                    $db = '&nbsp;';
                    $table = '&nbsp;';
                    $column = '&nbsp;';
                    $grantopt = FALSE;
                }
                // end if...else
                // Password Line
                if ($priv == '' && !$grantopt) {
                    continue;
                }
                // Checking the database (take into account wildcards)
                if ($dbcheck && ($db != '*' && $db != $dbcheck)) {
                    // TODO: db names may contain characters that are regexp
                    //       instructions
                    $re = '(^|(\\\\\\\\)+|[^\\])';
                    $db_regex = ereg_replace($re . '%', '\\1.*', ereg_replace($re . '_', '\\1.{1}', $db));
                    if (!eregi('^' . $db_regex . '$', $dbcheck)) {
                        continue;
                    }
                }
                // end if
                $bgcolor = $i % 2 ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo'];
                $revoke_url = 'sql.php' . '?' . $url_query . '&amp;sql_query=' . urlencode('REVOKE ' . $priv . ' ON ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ' FROM \'' . $row['User'] . '\'@\'' . $row['Host'] . '\'') . '&amp;zero_rows=' . urlencode(sprintf($GLOBALS['strRevokeMessage'], ' <span style="color: #002E80">' . $row['User'] . '@' . $row['Host'] . '</span>') . '<br />' . $GLOBALS['strRememberReload']) . '&amp;goto=user_details.php';
                if ($grantopt) {
                    $revoke_grant_url = 'sql.php' . '?' . $url_query . '&amp;sql_query=' . urlencode('REVOKE GRANT OPTION ON ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ' FROM \'' . $row['User'] . '\'@\'' . $row['Host'] . '\'') . '&amp;zero_rows=' . urlencode(sprintf($GLOBALS['strRevokeGrantMessage'], ' <span style="color: #002E80">' . $row['User'] . '@' . $row['Host'] . '</span>') . '<br />' . $GLOBALS['strRememberReload']) . '&amp;goto=user_details.php';
                }
                ?>
<tr>
                <?php 
                if (!$dbcheck) {
                    if ($priv) {
                        echo "\n";
                        ?>
    <td<?php 
                        if (!$grantopt) {
                            echo ' colspan="2"';
                        }
                        ?>
 bgcolor="<?php 
                        echo $bgcolor;
                        ?>
">
        <a href="<?php 
                        echo $revoke_url;
                        ?>
">
            <?php 
                        echo $GLOBALS['strRevokePriv'];
                        ?>
</a>
    </td>
                        <?php 
                    }
                    if ($grantopt) {
                        echo "\n";
                        ?>
    <td<?php 
                        if (!$priv) {
                            echo ' colspan="2"';
                        }
                        ?>
 bgcolor="<?php 
                        echo $bgcolor;
                        ?>
">
        <a href="<?php 
                        echo $revoke_grant_url;
                        ?>
">
            <?php 
                        echo $GLOBALS['strRevokeGrant'];
                        ?>
</a>
    </td>
                        <?php 
                    }
                } else {
                    if ($priv) {
                        echo "\n";
                        ?>
    <td bgcolor="<?php 
                        echo $bgcolor;
                        ?>
">
        <a href="<?php 
                        echo $revoke_url;
                        ?>
">
            <?php 
                        echo $GLOBALS['strRevoke'];
                        ?>
</a>
    </td>
                        <?php 
                    } else {
                        echo "\n";
                        ?>
    <td bgcolor="<?php 
                        echo $bgcolor;
                        ?>
">&nbsp;</td>
                        <?php 
                    }
                    echo "\n";
                    ?>
    <td bgcolor="<?php 
                    echo $bgcolor;
                    ?>
"><?php 
                    echo $row['Host'];
                    ?>
</td>
    <td bgcolor="<?php 
                    echo $bgcolor;
                    ?>
"><?php 
                    echo $row['User'] ? $row['User'] : '******' . $GLOBALS['strAny'] . '</span>';
                    ?>
</td>
                    <?php 
                }
                echo "\n";
                ?>
    <td bgcolor="<?php 
                echo $bgcolor;
                ?>
"><?php 
                echo $db == '*' ? '<span style="color: #002E80">' . $GLOBALS['strAll'] . '</span>' : $db;
                ?>
</td>
    <td bgcolor="<?php 
                echo $bgcolor;
                ?>
"><?php 
                echo $table == '*' ? '<span style="color: #002E80">' . $GLOBALS['strAll'] . '</span>' : $table;
                ?>
</td>
    <td bgcolor="<?php 
                echo $bgcolor;
                ?>
"><?php 
                echo $priv != '' ? $priv : '<span style="color: #002E80">' . $GLOBALS['strNoPrivileges'] . '</span>';
                ?>
</td>
                <?php 
                if (!$dbcheck) {
                    echo "\n";
                    ?>
    <td bgcolor="<?php 
                    echo $bgcolor;
                    ?>
"><?php 
                    echo $grantopt ? $GLOBALS['strYes'] : $GLOBALS['strNo'];
                    ?>
</td>
                    <?php 
                }
                echo "\n";
                ?>
    <!-- Debug <td bgcolor="<?php 
                echo $bgcolor;
                ?>
"><?php 
                echo $usr_row[0];
                ?>
</td> Debug -->
</tr>
                <?php 
                $i++;
                echo "\n";
            }
            // end while $usr_row
        }
        // end if $grants_cnt >0
        // $host_db_result is an array containing related to only one user
        // -> exit the loop
        if (is_array($host_db_result)) {
            break;
        }
    }
    // end while $row
    ?>
</table>
<hr />

    <?php 
    echo "\n";
    return TRUE;
}
Example #17
0
 public function getViews()
 {
     $EditableFields = array();
     $EditableJS = array();
     foreach ($this->getFields() as $field) {
         if ($field['editable']) {
             $OBjField = new Field($field['dataType'], $field['name'], $field['varname'], array('path' => "admin_" . strtolower($this->entityName)));
             $EditableFields[] = $OBjField->getHTML();
             $EditableJS[] = $OBjField->getJS();
         }
     }
     $files = array();
     $path = dirname(__FILE__) . "/Resources/views/" . $this->type;
     foreach (glob($path . "/*.twig") as $filename) {
         $body = "{# Generated by Tigreboite\\FunkylabBundle " . date("Y-m-d h:i:s") . " #}\n";
         $body .= file_get_contents($filename);
         $body = str_replace('%admin_entity_path%', "admin_" . strtolower($this->entityName), $body);
         $body = str_replace('%admin_entity_name%', UCFirst(strtolower($this->entityName)), $body);
         $body = str_replace('%editable_fields%', implode("\n", $EditableFields), $body);
         $body = str_replace('%javascript%', implode("\n", $EditableJS), $body);
         $files[basename($filename)] = $body;
     }
     return $files;
 }
Example #18
0
function coreCheckName($name, $check_name)
{
    global $upper_name;
    // Nicht-druckbare Zeichen, Leerzeichen, " und ' entfernen
    $name = preg_replace("/[ '" . chr(34) . chr(1) . "-" . chr(31) . "]/", "", $name);
    $name = str_replace("#", "", $name);
    $name = str_replace("+", "", $name);
    $name = trim($name);
    if (strlen($check_name) > 0 && strlen($name) > 0) {
        $i = 0;
        while ($i < strlen($name)) {
            if (!strstr($check_name, substr($name, $i, 1))) {
                if ($i > 0 && $i < strlen($name) - 1) {
                    $name = substr($name, 0, $i) . substr($name, $i + 1);
                } elseif ($i > 0) {
                    $name = substr($name, 0, -1);
                } else {
                    $name = substr($name, $i + 1);
                }
            } else {
                $i++;
            }
        }
        if (!strstr($check_name, substr($name, 0, 1))) {
            return substr($name, 1);
        }
    }
    if ($upper_name) {
        $name = UCFirst($name);
    }
    return $name;
}
 private function EnsureProjectFolders()
 {
     if (!is_dir($this->pathToProjectFolder)) {
         die("your project folder is invalid:" . $this->pathToProjectFolder);
     }
     $templateFolder = $this->pathToProjectFolder . "/resources/views/" . $this->subFolder;
     if (is_dir($templateFolder)) {
         //die ("  You already have a: \n  ". $this->subFolder ."\n  Please remove or rename it\n");
     }
     mkdir($templateFolder, 0777, false);
     $ControllerFolder = $this->pathToProjectFolder . "/app/Http/Controllers/" . UCFirst($this->subFolder);
     if (is_dir($ControllerFolder)) {
         die("  You already have a: \n  " . $ControllerFolder . "\n  Please remove or rename it\n");
     }
     mkdir($ControllerFolder, 0777, false);
 }
Example #20
0
 /**
  * Validate the domain and return kind data
  * @param array $request    the request
  * @return text             the help text (usually html)
  */
 public function validateDomain($request)
 {
     global $dsn;
     $result = array();
     $validChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_';
     $validPwChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';
     $request['dn_name'] = strToUpper($request['dn_name']);
     $request['dn_name'] = str_replace(' ', '_', $request['dn_name']);
     $domain = '';
     for ($i = 0; $i < strlen($request['dn_name']); $i++) {
         if (strpos($validChars, $request['dn_name'][$i]) !== false) {
             $domain .= $request['dn_name'][$i];
         }
     }
     $result['dn_name'] = $domain;
     $request['dn_name_alias'] = strToUpper($request['dn_name_alias']);
     $request['dn_name_alias'] = str_replace(' ', '_', $request['dn_name_alias']);
     $domain_alias = '';
     $validChars = $validChars . ',;';
     for ($i = 0; $i < strlen($request['dn_name_alias']); $i++) {
         if (strpos($validChars, $request['dn_name_alias'][$i]) !== false) {
             $domain_alias .= $request['dn_name_alias'][$i];
         }
     }
     $result['dn_name_alias'] = $domain_alias;
     if (isset($request['is_alias']) && $request['is_alias'] == 'F') {
         if (in_array($domain, R3EcoGisCustomerHelper::getDomainsList($this->auth))) {
             return array('status' => R3_AJAX_ERROR, 'error' => array('text' => 'Attenzione! Dominio già esistente'));
         }
         // Generate password
         $domainLower = strtolower($domain);
         $pw = '';
         $pw2 = '';
         for ($i = 0; $i < 8; $i++) {
             $pw .= $validPwChars[rand(0, strlen($validPwChars) - 1)];
             $pw2 .= $validPwChars[rand(0, strlen($validPwChars) - 1)];
         }
         $result['cus_name_1'] = UCWords(str_replace('_', ' ', $domainLower));
         $result['cus_name_2'] = $result['cus_name_1'];
         $result['us_name'] = 'Administrator (' . UCFirst($domainLower) . ')';
         $result['us_login'] = '******';
         $result['us_password'] = $pw2;
         $result['dn_name_lower'] = $domainLower;
         if ($this->isMultiDomain()) {
             $result['do_schema'] = 'geo_' . $domainLower;
             $result['do_gc_mapset'] = 'r3-ecogis-' . strtolower($request['dn_name']);
         } else {
             $result['do_schema'] = 'geo';
             $result['do_gc_mapset'] = 'r3-ecogis';
         }
         $result['do_gc_project'] = strtolower($request['dn_name']);
     }
     return $result;
 }
Example #21
0
	<div id="lowupusr">
	<table width='100%'>
		<tr>
			<th align='center' width="140px">Userid</th>
			<th align='center' width="250px">Username</th>
			<th align='center' width="110px">Type</th>
			<th align='center' width="140px">Directories</th>
			<th align='center' width="140px">Files</th>
			<th align='center' width="180px">Used Space</th>
			<th align='center' width='150px'>Join Date</th>
		</tr>
	</table>
	</div>
</div>

<?php 
require "../config/connect.php";
require "../engine/countdirfile.php";
require "../engine/countspace.php";
//This is User List
if (isset($_POST['str'])) {
    //Search Mode
    $list = mysql_query("select * from users where username like '%" . $_POST['str'] . "%' order by userid") or die(mysql_error());
} else {
    //Listing Mode
    $list = mysql_query("select * from users order by userid") or die(mysql_error());
}
//Fetching Result
while ($result = mysql_fetch_array($list)) {
    echo "<table class='lstusr' width='100%' cellspacing='0' cellpadding='0' style='border-bottom:1px solid #bfb2eb;padding:5;'>\n\t\t\t<tr onclick='vwprofile(" . $result['userid'] . ")' class='lstusrn'>\n\t\t\t\t<td align='center' width='150px'>" . $result['userid'] . "</td>\n\t\t\t\t<td align='center' width='280px'>" . UCFirst($result['username']) . "</td>\n\t\t\t\t<td align='center' width='120px'>" . UCFirst($result['type']) . "</td>\n\t\t\t\t<td align='center' width='150px'>" . countdir($result['userid']) . " Directories</td>\n\t\t\t\t<td align='center' width='160px'>" . countfile($result['userid']) . " Files</td>\n\t\t\t\t<td align='center' width='200px'>" . countspace($result['userid']) . " MB Used Space</td>\n\t\t\t\t<td align='center' width='160px'>" . $result['jdate'] . "</td>\n\t\t  </tr>\n\t\t </table>";
}
 public function BuildControllerComments()
 {
     // Add some comments so that new users have a starting point on what to add to the routes.php file
     $string = " * --- begin route block --- \n\n";
     $string .= "  Route::group([ 'prefix' => '" . $this->subFolder . "', 'namespace' => '" . UCFirst($this->subFolder) . "'], function(){\n";
     $string .= "    Route::get('/', 'MasterIndexController@index');\n";
     foreach ($this->tables as $table) {
         $string .= "    Route::resource('" . Pluralizer::plural($table) . "', '" . UCFirst(Pluralizer::plural($table)) . "Controller');\n";
     }
     $string .= "  });\n\n";
     $string .= " * --- end route block   --- \n";
     $this->controllercomments = $string;
 }
 function __f__f9ff587963c28431eafbee59e188371c($id = null)
 {
     $_ips___x_retval = '';
     $__iteratorCount = 0;
     foreach (array('facebook', 'twitter') as $service) {
         $prefs = is_array($prefs) ? $prefs : IPSMember::getFromMemberCache($this->memberData, 'postSocialPrefs');
         $__iteratorCount++;
         $_ips___x_retval .= "\n\t\t\t\t\t\t" . (IPSMember::canSocialShare($service) ? "<li class='ipsField ipsField_checkbox left' style='margin-right: 40px'>\n\t\t\t\t<input type=\"checkbox\" name=\"{$id}share_x_{$service}\" class=\"input_check _share_x_\" value=\"yes\" id='{$id}share_x_{$service}' " . (!empty($_REQUEST['share_' . $service]) || !empty($prefs[$service]) ? "checked='checked'" : "") . " /> &nbsp;&nbsp;\n\t\t\t\t<span class='' data-tooltip='" . sprintf($this->lang->words['gbl_post_to_x_tt'], UCFirst($service)) . "'>\n\t\t\t\t\t<label for='{$id}share_x_{$service}'> <img src=\"{$this->settings['public_dir']}style_extra/sharelinks/{$service}.png\" style='vertical-align:top' alt='' /> &nbsp; " . sprintf($this->lang->words['gbl_post_to_x'], UCFirst($service)) . "</label>\n\t\t\t\t</span>\n\t\t\t</li>" : "") . "\n\t\t\n";
     }
     $_ips___x_retval .= '';
     unset($__iteratorCount);
     return $_ips___x_retval;
 }
 function Editor($title, $name, $config = array(), $callback = false, $pxWidth = 720, $pxHeight = 400)
 {
     // get lower case array key's
     $config = !is_array($config) ? array() : $this->makeSave($config, "strToLower");
     // get the full config
     foreach ($this->defaultEditorCfg as $key => $value) {
         if (!$this->arrayKeyExists($key, $config) || empty($config[$key])) {
             $config[$key] = $this->defaultEditorCfg[$key];
         }
         if (is_bool($config[$key])) {
             $config[$key] = $config[$key] ? "true" : "false";
         }
     }
     // value of the field(s)
     $value = $this->Value($name, true);
     $bgcolor = $this->value($name . "_bgcolor");
     // make a editor if the browser is compatible
     if (!$this->FCKCompatible()) {
         $this->TextArea($title, $name);
         return;
     } else {
         $field = "<iframe src=\"{$this->fckFile}?FormName={$this->formName}&FieldName={$name}&Toolbar=" . UCFirst($config["toolbar"]) . "&Browse=" . ($config["browse"] ? "true" : "false") . "&Upload=" . ($config["upload"] ? "true" : "false") . "\" width=\"{$pxWidth}\" height=\"{$pxHeight}\" frameborder=\"no\" scrolling=\"no\"></iframe>\n";
         $field .= "<input type=\"hidden\" name=\"{$name}\" value=\"{$value}\">\n";
         $field .= "<input type=\"hidden\" name=\"{$name}_bgcolor\" value=\"" . (empty($bgcolor) ? "#FFFFFF" : $bgcolor) . "\" />\n";
     }
     $this->fieldNames[] = "{$name}_bgcolor";
     $this->generateField($title, $field, $name, $this->callUserFunction($callback, $value));
 }