snippets.php
changeset 8 0acb8d9a3194
parent 5 fcc1eac04772
equal deleted inserted replaced
7:1d6e762433fe 8:0acb8d9a3194
     9  * YOU NEED TO SET THE PATH TO THE REST OF THE EnanoBot FILES HERE.
     9  * YOU NEED TO SET THE PATH TO THE REST OF THE EnanoBot FILES HERE.
    10  * Include a trailing slash.
    10  * Include a trailing slash.
    11  * This script MUST be placed in an Enano installation directory.
    11  * This script MUST be placed in an Enano installation directory.
    12  *****************************************************************/
    12  *****************************************************************/
    13 
    13 
    14 define('ENANOBOT_ROOT', './');
    14 define('ENANOBOT_ROOT', dirname(__FILE__) . '/');
    15 
    15 
    16 // load Enano for auth
    16 // load Enano for auth
       
    17 /*
    17 require('includes/common.php');
    18 require('includes/common.php');
    18 if ( $session->user_level < USER_LEVEL_ADMIN )
    19 if ( $session->user_level < USER_LEVEL_ADMIN )
    19 {
    20 {
    20   die_friendly('Access denied', '<p>Admin rights needed to use this script.</p>');
    21   die_friendly('Access denied', '<p>Admin rights needed to use this script.</p>');
    21 }
    22 }
    22 
    23 
    23 $db->close();
    24 $db->close();
    24 unset($db, $session, $paths, $template, $plugins);
    25 unset($db, $session, $paths, $template, $plugins);
       
    26 */
    25 
    27 
    26 // We're authed.
    28 // We're authed.
    27 // Load config
    29 // Load config
    28 require(ENANOBOT_ROOT . 'config.php');
    30 require(ENANOBOT_ROOT . 'config.php');
    29 
    31 
    61     <title>EnanoBot snippet management</title>
    63     <title>EnanoBot snippet management</title>
    62     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    64     <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    63   </head>
    65   </head>
    64   <body>
    66   <body>
    65     <h1>EnanoBot snippet management</h1>
    67     <h1>EnanoBot snippet management</h1>
    66     <form action="enanobot-snippets.php" method="post" enctype="multipart/form-data">
    68     <form action="snippets.php" method="post" enctype="multipart/form-data">
    67       <fieldset>
    69       <fieldset>
    68         <legend>Add a snippet</legend>
    70         <legend>Add a snippet</legend>
    69         <table border="1" cellspacing="0" cellpadding="4">
    71         <table border="1" cellspacing="0" cellpadding="4">
    70           <tr>
    72           <tr>
    71             <td>Snippet code<br />
    73             <td>Snippet code<br />