protected function process_conf($value)
 {
     if (!strlen($value)) {
         return;
     }
     $line_start = 'user_pref(';
     $line_end = ');';
     $values = parse_lines($value);
     $conf_values = array();
     foreach ($values as $line) {
         $line = Utf8ToWin(trim($line));
         if (str_begins($line, $line_start) && str_ends($line, $line_end)) {
             $line = stripslashes(substr($line, strlen($line_start), -strlen($line_end)));
             if (strlen($line) < 2) {
                 continue;
             }
             $name_end = strpos($line, '",');
             if ($name_end !== false && $line[0] == '"') {
                 $name = substr($line, 1, $name_end - 1);
                 $value = trim(substr($line, $name_end + 2));
                 if (str_begins($value, '"') && str_ends($value, '"')) {
                     $value = trim(substr($value, 1, -1));
                 }
                 $name = strtolower($name);
                 $conf_values[$name] = $value;
             }
         }
     }
     $accounts = assign($conf_values['mail.accountmanager.accounts']);
     $accounts = explode(',', $accounts);
     if (is_array($accounts) && count($accounts)) {
         foreach ($accounts as $account) {
             $server = assign($conf_values['mail.account.' . $account . '.server']);
             $host = assign($conf_values['mail.server.' . $server . '.hostname']);
             $port = assign($conf_values['mail.server.' . $server . '.port']);
             $user = assign($conf_values['mail.server.' . $server . '.username']);
             $protocol = assign($conf_values['mail.server.' . $server . '.type']);
             $pass = '';
             if ($protocol == 'imap') {
                 if (isset($this->mailboxes['imap://' . $host])) {
                     $pass = $this->mailboxes['imap://' . $host][1];
                 }
             } elseif ($protocol == 'pop3') {
                 if (isset($this->mailboxes['pop3://' . $host])) {
                     $pass = $this->mailboxes['pop3://' . $host][1];
                 }
             }
             if (!strlen($pass)) {
                 if (isset($this->mailboxes['mailbox://' . $host])) {
                     $pass = $this->mailboxes['mailbox://' . $host][1];
                 } else {
                     $pass = '';
                 }
             }
             $identities = assign($conf_values['mail.account.' . $account . '.identities']);
             $identities = explode(',', $identities);
             if (is_array($identities) && count($identities)) {
                 foreach ($identities as $identity) {
                     $email = assign($conf_values['mail.identity.' . $identity . '.useremail']);
                     $smtp_name = assign($conf_values['mail.identity.' . $identity . '.smtpserver']);
                     // find default server
                     if (!strlen($smtp_name)) {
                         $smtp_name = assign($conf_values['mail.smtp.defaultserver']);
                     }
                     if (!strlen($smtp_name)) {
                         $smtp_names = assign($conf_values['mail.smtpservers']);
                         $smtp_names = explode(',', $smtp_names);
                         if (is_array($smtp_names) && count($smtp_names)) {
                             $smtp_name = $smtp_names[0];
                         }
                     }
                     $smtp_host = assign($conf_values['mail.smtpserver.' . $smtp_name . '.hostname']);
                     $smtp_user = assign($conf_values['mail.smtpserver.' . $smtp_name . '.username']);
                     $smtp_port = assign($conf_values['mail.smtpserver.' . $smtp_name . '.port']);
                     if (isset($this->mailboxes['smtp://' . $smtp_host])) {
                         $smtp_pass = $this->mailboxes['smtp://' . $smtp_host][1];
                     } else {
                         $smtp_pass = '';
                     }
                     if (is_array($smtp_pass)) {
                         $smtp_pass = $smtp_pass[1];
                     }
                     // pop3/imap
                     if ($protocol == 'pop3' || $protocol == 'imap') {
                         $this->add_email($email, $protocol, $host, $port, $user, $pass);
                     }
                     $this->add_email($email, 'smtp', $smtp_host, $smtp_port, $smtp_user, $smtp_pass);
                 }
             }
         }
     }
 }
Example #2
0
    ?>
</a></li>
			<?php 
    if ($_SESSION['profil'] == PROFIL_ADMIN) {
        ?>
 
			
				<li><a href="integrate.php" <?php 
        echo str_ends($_SERVER['SCRIPT_NAME'], '/integrate.php') ? 'class="current"' : '';
        ?>
><?php 
        echo t('Gadgets');
        ?>
</a></li>				
				<li><a href="settings.php" <?php 
        echo str_ends($_SERVER['SCRIPT_NAME'], '/settings.php') ? 'class="current"' : '';
        ?>
><?php 
        echo t('Settings');
        ?>
</a></li>
			<?php 
    }
    ?>
			
			</ul>
			<?php 
}
?>
			
		</div>
Example #3
0
$menus[] = plxUtils::formatMenu(L_MENU_PROFIL, $plxMotor->urlRewrite() . 'core/admin/profil.php', L_MENU_PROFIL_TITLE);
#menu des fonctionnalités de gutuma
$menu_gutuma = '';
if ($_SESSION['profil'] == PROFIL_ADMIN) {
    $menu_gutuma .= '
			<li ' . (str_ends($_SERVER['SCRIPT_NAME'], '/index.php') ? 'class="menu active sub">' : 'class="menu sub">') . '<a href="index.php">' . t('Home') . '</a></li>
			';
}
$menu_gutuma .= '
			<li ' . (str_ends($_SERVER['SCRIPT_NAME'], '/compose.php') ? 'class="menu active sub">' : 'class="menu sub">') . ' <a href="compose.php">' . t('Newsletters') . '</a></li>
			<li ' . (str_ends($_SERVER['SCRIPT_NAME'], '/lists.php') ? 'class="menu active sub">' : 'class="menu sub">') . '<a href="lists.php">' . t('Lists') . '</a></li>
			';
if ($_SESSION['profil'] == PROFIL_ADMIN) {
    $menu_gutuma .= '
			<li ' . (str_ends($_SERVER['SCRIPT_NAME'], '/integrate.php') ? 'class="menu active sub">' : 'class="menu sub">') . '<a href="integrate.php">' . t('Gadgets') . '</a></li>
			<li ' . (str_ends($_SERVER['SCRIPT_NAME'], '/settings.php') ? 'class="menu active sub">' : 'class="menu sub">') . '<a href="settings.php">' . t('Settings') . '</a></li>
			';
}
# récuperation des menus admin pour les plugins
foreach ($plxAdmin->plxPlugins->aPlugins as $plugName => $plugInstance) {
    if ($plugInstance and is_file(PLX_PLUGINS . $plugName . '/admin.php')) {
        if ($plxAdmin->checkProfil($plugInstance->getAdminProfil(), false)) {
            if ($plugInstance->adminMenu) {
                $menu = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->adminMenu['title']), $plxAdmin->racine . 'core/admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->adminMenu['caption']));
                array_splice($menus, $plugInstance->adminMenu['position'] - 1, 0, $menu);
                $menus[] = $menu;
            } else {
                if ($plugName == 'gutuma') {
                    $menus[] = '<li class="menu"><a href="' . $plxAdmin->racine . 'core/admin/plugin.php?p=gutuma" title="Gutuma">Gutuma</a></li>' . $menu_gutuma;
                } else {
                    $menus[] = plxUtils::formatMenu(plxUtils::strCheck($plugInstance->getInfo('title')), $plxAdmin->racine . 'core/admin/plugin.php?p=' . $plugName, plxUtils::strCheck($plugInstance->getInfo('title')));
Example #4
0
 /**
  * Loads all of the lists
  * @param bool $load_addresses TRUE if lists addresses should be loaded (default is FALSE)
  * @param bool $inc_private TRUE if private lists should included (default is TRUE)
  * @return mixed Array of lists or FALSE if an error occured
  */
 public static function get_all($load_addresses = FALSE, $inc_private = TRUE)
 {
     $lists = array();
     if ($dh = @opendir(realpath(GUTUMA_LISTS_DIR))) {
         while (($file = readdir($dh)) !== FALSE) {
             if (!is_dir($file) && str_ends($file, '.php')) {
                 $list = gu_list::get(substr($file, 0, strlen($file - 4)), $load_addresses);
                 if ($inc_private || !$list->private) {
                     $lists[] = $list;
                 }
             }
         }
         closedir($dh);
     }
     return $lists;
 }
Example #5
0
include_once '../fns/redirect.php';
include_once '../fns/request_strings.php';
include_once '../classes/File.php';
include_once '../classes/FileSystemException.php';
include_once '../common.php';
header('Cache-Control: no-cache');
header('Content-Type: application/json');
list($path) = request_strings('path');
try {
    $item = $fileSystem->getItem($path);
    if ($item instanceof File) {
        header('Content-Type: ' . $item->getContentType());
        $content = $item->getContent();
        echo $content['content'];
    } else {
        if (str_ends($path, '/') || !$path) {
            $html = '<!DOCTYPE html>' . '<html>' . '<head>' . '<title>' . htmlspecialchars($path) . '</title>' . '</head>' . '<body>' . '<h1>Index of root/' . htmlspecialchars($path) . '</h1>';
            $index = $item;
            if ($index['parentFolderPath'] !== null) {
                array_unshift($index['items'], ['type' => 'parent-folder', 'name' => '.. Parent Folder']);
            }
            $items = $index['items'];
            if ($items) {
                foreach ($items as $item) {
                    $name = $href = $item['name'];
                    $type = $item['type'];
                    if ($type == 'parent-folder') {
                        $href = '..';
                        $name = '.. Parent Folder';
                    } elseif ($type == 'folder') {
                        $href .= '/';