* furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */
require dirname(dirname(__FILE__)) . "/conf/config.php";
require dirname(__FILE__) . "/class.rFastTemplate.php";
$tpl = new rFastTemplate($templatedir);
# get the list parameter and check that list exists
$list = $_GET["list"];
if (!isset($list)) {
    die("no list specified");
}
if (dirname(dirname(realpath($topdir . "/" . $list))) != realpath($topdir)) {
    die("list outside topdir");
}
if (!is_dir($topdir . "/" . $list)) {
    die("non-existent list");
}
# this will be displayed on the top of the page
$message = "";
# subscribe some people if tosubscribe is set
if (isset($_POST["tosubscribe"])) {
Example #2
0
    $value = "";
    if (is_file($file)) {
        $value = file_get_contents($file);
    }
    // the last \n would result in an extra empty line in the list box,
    // so we remove it
    $value = preg_replace('/\\n$/', "", $value);
    $tpl->assign(array("NAME" => htmlentities($name), "NICENAME" => htmlentities($nicename), "TEXT" => htmlentities($text), "VALUE" => htmlentities($value)));
    $tpl->parse("ROWS", ".list");
}
// Perl's encode_entities (to be able to use tunables.pl)
function encode_entities($str)
{
    return htmlentities($str);
}
$tpl = new rFastTemplate($templatedir);
$list = $_GET["list"];
if (!isset($list)) {
    die("no list specified");
}
if (dirname(dirname(realpath($topdir . "/" . $list))) != realpath($topdir)) {
    die("list outside topdir");
}
if (!is_dir($topdir . "/" . $list)) {
    die("non-existent list");
}
$tpl->define(array("main" => "edit.html", "boolean" => "edit_boolean.html", "string" => "edit_string.html", "list" => "edit_list.html"));
$tpl->assign(array("LIST" => htmlentities($list)));
$tunables = file_get_contents($confdir . '/tunables.pl');
eval($tunables);
$tpl->parse("MAIN", "main");
Example #3
0
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */
require dirname(dirname(__FILE__)) . "/conf/config.php";
require dirname(__FILE__) . "/class.rFastTemplate.php";
$tpl = new rFastTemplate($templatedir);
$tpl->define(array("main" => "index.html"));
$lists = "";
// get top directories (domains)
$domains = array_diff(scandir($topdir), array('..', '.'));
// get second level dirs (lists)
foreach ($domains as $domain) {
    // top-level domain dir
    $domaindir = $topdir . '/' . $domain;
    if (is_dir($domaindir)) {
        $lists .= "<h2>{$domain}</h2>\n<ul>";
        foreach (array_diff(scandir($domaindir), array('..', '.')) as $list) {
            $listurl = urlencode($domain . '/' . $list);
            $lists .= "\n\t<li><strong>" . htmlentities($list) . ':</strong>&nbsp;&nbsp;' . '<a href="edit.php?list=' . $listurl . '">config</a> - <a href="subscribers.php?list=' . $listurl . '">subscribers</a>' . "\n</li>";
        }
        $lists .= "\n</ul>";
Example #4
0
            die("Couldn't chmod " . $file);
        }
    } else {
        if (file_exists($file)) {
            if (!unlink($file)) {
                die("Couldn't unlink " . $file);
            }
        }
    }
}
// Perl's encode_entities (to be able to use tunables.pl)
function encode_entities($str)
{
    return htmlentities($str);
}
$tpl = new rFastTemplate($templatedir);
$list = $_POST["list"];
if (!isset($list)) {
    die("no list specified");
}
if (dirname(dirname(realpath($topdir . "/" . $list))) != realpath($topdir)) {
    die("list outside topdir");
}
if (!is_dir($topdir . "/" . $list)) {
    die("non-existent list");
}
$tpl->define(array("main" => "save.html"));
$tpl->assign(array("LIST" => htmlentities($list)));
$tunables = file_get_contents($confdir . '/tunables.pl');
eval($tunables);
$tpl->parse("MAIN", "main");