Ejemplo n.º 1
0
 // drop existing poMMo tables
 foreach (array_keys($dbo->table) as $key) {
     $table = $dbo->table[$key];
     $sql = 'DROP TABLE IF EXISTS ' . $table;
     $dbo->query($sql);
 }
 if (isset($_REQUEST['debugInstall'])) {
     $dbo->debug(TRUE);
 }
 $install = Pommo_Install::parseSQL();
 if ($install) {
     // installation of DB went OK, set configuration values to user
     // supplied ones
     require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
     $pass = $_POST['admin_password'];
     $user = new Pommo_User();
     $user->save('admin', $pass);
     // Save Mailing List, Name of Website, Website URL
     Pommo_Install::saveUserValues($_POST);
     // generate key to uniquely identify this installation
     $key = Pommo_Helper::makeCode(6);
     Pommo_Api::configUpdate(array('key' => $key), TRUE);
     Pommo::reloadConfig();
     // load configuration [depricated?], set message defaults, load templates
     require_once Pommo::$_baseDir . 'classes/Pommo_Helper_Messages.php';
     Pommo_Helper_Messages::resetDefault('all');
     // install templates
     $file = Pommo::$_baseDir . 'sql/sql.templates.php';
     if (!Pommo_Install::parseSQL(false, $file)) {
         $logger->addErr('Error Loading Default Mailing Templates.');
     }
Ejemplo n.º 2
0
        $state =& Pommo_Api::stateInit('mailing', array('fromname' => $mailing['fromname'], 'fromemail' => $mailing['fromemail'], 'frombounce' => $mailing['frombounce'], 'list_charset' => $mailing['charset'], 'mailgroup' => $gid, 'subject' => $mailing['subject'], 'body' => $mailing['body'], 'altbody' => $mailing['altbody']));
        Pommo::redirect(Pommo::$_baseUrl . 'mailings_start.php');
        break;
    case 'delete':
        $currentUser = Pommo::$_auth->_username;
        //	We dont want to delete the current user
        $key = array_search($currentUser, $_GET['users']);
        if ($key !== false) {
            unset($_GET['users'][$key]);
        }
        require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
        $pu = new Pommo_User();
        $deleted = $pu->delete($_GET['users']);
        $logger->addMsg(Pommo::_T('Please Wait') . '...');
        $params = $json->encode(array('users' => $_GET['users']));
        $view->assign('callbackFunction', 'deleteUser');
        $view->assign('callbackParams', $params);
        break;
    case 'add':
        require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
        $pu = new Pommo_User();
        if ($pu->save($_POST['user'], $_POST['password'])) {
            echo $_POST['user'];
            return;
        }
        break;
    default:
        $logger->AddErr('invalid call');
        break;
}
$view->display('admin/rpc');
Ejemplo n.º 3
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
*********************************/
require '../bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Mailing.php';
require_once Pommo::$_baseDir . 'classes/Pommo_User.php';
Pommo::init();
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
//	Get the users
$user = new Pommo_User();
$data = array('limit' => $_GET['rows'], 'page' => $_GET['page']);
$list = $user->getList($data);
//	Format the list for jqgrid
$rows = array();
$i = 0;
foreach ($list as $item) {
    $rows[$i]['id'] = $item['username'];
    $rows[$i]['username'] = $item['username'];
    $i++;
}
$json = array('total' => $user->pages, 'page' => $_GET['page'], 'records' => $user->records, 'rows' => $rows);
echo json_encode($json);