#11 usermanager.php problems

closed
nobody
None
5
2006-12-11
2006-11-01
Anonymous
No

Tried to get working IPplan 4.80b with Oracle 10g and
everything was OK until I tried to add a new user or
group. It produces the following errors and creates
new user or group with blank name.

PHP 4.3.10-16 (Linux)
NOTICE: [8] Undefined index: grp Line: 121
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: userid Line: 122
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 139
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 140
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 139
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 140
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 653
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 654
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grpdescrip Line: 654
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 653
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grp Line: 654
File: /var/www/ipplan/admin/usermanager.php

NOTICE: [8] Undefined index: grpdescrip Line: 654
File: /var/www/ipplan/admin/usermanager.php

Discussion

  • Logged In: NO

    Oracle driver is oci8

     
  • Logged In: YES
    user_id=230197

    Turn on database debug in config.php - I guess when you
    created the initial IPplan schema the sequences where not
    created. Most of the tables have autoincrement fields
    simulated by ORACLE sequences and triggers.

     
  • Logged In: NO

    I used this script to create tables, sequences and indexes (generated by install.php) - if
    anything missed there?

    #snmp support not compiled into php
    #importing from routing tables and direct query of device will not work

    #zlib support compiled into php
    #output to webrowser will be compressed for quicker loading of pages if web browser supports
    compression

    CREATE TABLE area (
    areaaddr DECIMAL(20) DEFAULT 0,
    descrip VARCHAR(80) NOT NULL,
    areaindex DECIMAL(20) NOT NULL,
    customer DECIMAL(10) DEFAULT 0,
    PRIMARY KEY (areaindex)
    );

    CREATE SEQUENCE SEQ_area ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_area BEFORE insert ON area FOR EACH ROW WHEN (NEW.areaindex IS
    NULL OR NEW.areaindex = 0) BEGIN select SEQ_area.nextval into :new.areaindex from dual; END;;

    CREATE UNIQUE INDEX area_customer ON area (customer, descrip);

    CREATE UNIQUE INDEX area_areaaddr ON area (areaaddr, customer);

    CREATE TABLE auditlog (
    userid VARCHAR(40),
    action VARCHAR(254) NOT NULL,
    dt DATE DEFAULT SYSDATE NOT NULL
    );

    CREATE INDEX auditlog_dt ON auditlog (dt);

    CREATE TABLE base (
    baseaddr DECIMAL(20) DEFAULT 0,
    subnetsize DECIMAL(20) DEFAULT 0,
    descrip VARCHAR(80) NOT NULL,
    baseindex DECIMAL(20) NOT NULL,
    admingrp VARCHAR(40) NOT NULL,
    customer DECIMAL(10) DEFAULT 0,
    lastmod DATE DEFAULT SYSDATE NOT NULL,
    userid VARCHAR(40),
    baseopt DECIMAL(20) DEFAULT 0,
    swipmod DATE,
    PRIMARY KEY (baseindex)
    );

    CREATE SEQUENCE SEQ_base ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_base BEFORE insert ON base FOR EACH ROW WHEN (NEW.baseindex IS
    NULL OR NEW.baseindex = 0) BEGIN select SEQ_base.nextval into :new.baseindex from dual; END;;

    CREATE UNIQUE INDEX base_baseaddr ON base (baseaddr, customer);

    CREATE INDEX base_customer ON base (customer);

    CREATE INDEX base_admingrp ON base (admingrp);

    CREATE TABLE baseadd (
    baseindex DECIMAL(20) DEFAULT 0,
    info VARCHAR(4000),
    infobin BLOB,
    infobinfn VARCHAR(255),
    PRIMARY KEY (baseindex)
    );

    CREATE TABLE custinfo (
    customer DECIMAL(10) DEFAULT 0,
    org VARCHAR(100),
    street VARCHAR(255),
    city VARCHAR(80),
    state VARCHAR(2),
    zipcode VARCHAR(10),
    cntry VARCHAR(2),
    maint VARCHAR(80),
    nichandl VARCHAR(80),
    lname VARCHAR(80),
    fname VARCHAR(80),
    mname VARCHAR(80),
    torg VARCHAR(100),
    tstreet VARCHAR(255),
    tcity VARCHAR(80),
    tstate VARCHAR(2),
    tzipcode VARCHAR(10),
    tcntry VARCHAR(2),
    phne VARCHAR(20),
    mbox VARCHAR(100),
    PRIMARY KEY (customer)
    );

    CREATE TABLE custadd (
    customer DECIMAL(10) DEFAULT 0,
    info VARCHAR(4000),
    infobinfn VARCHAR(255),
    PRIMARY KEY (customer)
    );

    CREATE TABLE customer (
    custdescrip VARCHAR(80) NOT NULL,
    customer DECIMAL(10) NOT NULL,
    crm VARCHAR(20),
    admingrp VARCHAR(40) NOT NULL,
    PRIMARY KEY (customer)
    );

    CREATE SEQUENCE SEQ_customer ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_customer BEFORE insert ON customer FOR EACH ROW WHEN
    (NEW.customer IS NULL OR NEW.customer = 0) BEGIN select SEQ_customer.nextval into :new.customer
    from dual; END;;

    CREATE UNIQUE INDEX customer_custdescrip ON customer (custdescrip);

    CREATE INDEX customer_crm ON customer (crm);

    CREATE INDEX customer_admingrp ON customer (admingrp);

    CREATE TABLE grp (
    grpdescrip VARCHAR(80) NOT NULL,
    grp VARCHAR(40) NOT NULL,
    createcust VARCHAR(1) DEFAULT 'N' NOT NULL,
    resaddr DECIMAL(10) DEFAULT 0,
    grpopt DECIMAL(20) DEFAULT 0,
    PRIMARY KEY (grp)
    );

    CREATE UNIQUE INDEX grp_grpdescrip ON grp (grpdescrip);

    CREATE TABLE ipaddr (
    ipaddr DECIMAL(20) DEFAULT 0,
    userinf VARCHAR(80),
    location VARCHAR(80),
    telno VARCHAR(15),
    descrip VARCHAR(80),
    hname VARCHAR(100),
    macaddr VARCHAR(12),
    baseindex DECIMAL(20) DEFAULT 0,
    lastmod DATE DEFAULT SYSDATE NOT NULL,
    lastpol DATE,
    userid VARCHAR(40),
    PRIMARY KEY (ipaddr, baseindex)
    );

    CREATE INDEX ipaddr_baseindex ON ipaddr (baseindex);

    CREATE TABLE ipaddradd (
    ipaddr DECIMAL(20) DEFAULT 0,
    baseindex DECIMAL(20) DEFAULT 0,
    info VARCHAR(4000),
    infobin BLOB,
    infobinfn VARCHAR(255),
    PRIMARY KEY (ipaddr, baseindex)
    );

    CREATE INDEX ipaddradd_baseindex ON ipaddradd (baseindex);

    CREATE TABLE ipaddrlnk (
    ipaddr DECIMAL(20) DEFAULT 0,
    baseindex DECIMAL(20) DEFAULT 0,
    customer DECIMAL(10) DEFAULT 0,
    dstipaddr DECIMAL(20) DEFAULT 0,
    dstcustomer DECIMAL(10) DEFAULT 0
    );

    CREATE UNIQUE INDEX ipaddrlnk_uniq ON ipaddrlnk (baseindex, ipaddr, customer, dstipaddr,
    dstcustomer);

    CREATE INDEX ipaddrlnk_dst ON ipaddrlnk (dstipaddr, dstcustomer);

    CREATE INDEX ipaddrlnk_src ON ipaddrlnk (ipaddr, customer);

    CREATE TABLE requestip (
    requestindex DECIMAL(10) NOT NULL,
    customer DECIMAL(10) DEFAULT 0,
    requestdesc VARCHAR(80),
    userinf VARCHAR(80),
    location VARCHAR(80),
    telno VARCHAR(15),
    descrip VARCHAR(80),
    hname VARCHAR(100),
    macaddr VARCHAR(12),
    lastmod DATE DEFAULT SYSDATE NOT NULL,
    info VARCHAR(4000),
    PRIMARY KEY (requestindex)
    );

    CREATE SEQUENCE SEQ_requestip ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_requestip BEFORE insert ON requestip FOR EACH ROW WHEN
    (NEW.requestindex IS NULL OR NEW.requestindex = 0) BEGIN select SEQ_requestip.nextval
    into :new.requestindex from dual; END;;

    CREATE UNIQUE INDEX requestip_desc ON requestip (customer, requestdesc);

    CREATE TABLE range (
    rangeaddr DECIMAL(20) DEFAULT 0,
    rangesize DECIMAL(20) DEFAULT 0,
    descrip VARCHAR(80) NOT NULL,
    rangeindex DECIMAL(20) NOT NULL,
    areaindex DECIMAL(20) DEFAULT 0,
    customer DECIMAL(10) DEFAULT 0,
    PRIMARY KEY (rangeindex)
    );

    CREATE SEQUENCE SEQ_range ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_range BEFORE insert ON range FOR EACH ROW WHEN (NEW.rangeindex
    IS NULL OR NEW.rangeindex = 0) BEGIN select SEQ_range.nextval into :new.rangeindex from dual;
    END;;

    CREATE INDEX range_rangeaddr ON range (rangeaddr, customer);

    CREATE UNIQUE INDEX range_customer ON range (customer, descrip);

    CREATE INDEX range_areaindex ON range (areaindex);

    CREATE TABLE revdns (
    customer DECIMAL(10) DEFAULT 0,
    hname VARCHAR(100) NOT NULL,
    ipaddr VARCHAR(15) NOT NULL,
    horder DECIMAL(3) DEFAULT 0
    );

    CREATE INDEX revdns_customer ON revdns (customer);

    CREATE TABLE schema (
    version DECIMAL(10) DEFAULT 0
    );

    CREATE TABLE users (
    userid VARCHAR(40) NOT NULL,
    userdescrip VARCHAR(80) NOT NULL,
    password VARCHAR(40) NOT NULL,
    PRIMARY KEY (userid)
    );

    CREATE TABLE usergrp (
    userid VARCHAR(40) NOT NULL,
    grp VARCHAR(40) NOT NULL
    );

    CREATE UNIQUE INDEX usergrp_userid ON usergrp (userid, grp);

    CREATE INDEX usergrp_grp ON usergrp (grp);

    CREATE TABLE bounds (
    boundsaddr DECIMAL(20) DEFAULT 0,
    boundssize DECIMAL(20) DEFAULT 0,
    grp VARCHAR(40) NOT NULL
    );

    CREATE INDEX bounds_grp ON bounds (grp);

    CREATE INDEX bounds_boundsaddr ON bounds (boundsaddr);

    CREATE TABLE fwdzone (
    data_id DECIMAL(20) NOT NULL,
    domain VARCHAR(254) NOT NULL,
    createmod DATE,
    lastmod DATE,
    regmod DATE,
    expiremod DATE,
    engineer VARCHAR(254),
    error_message VARCHAR(254),
    responsiblemail VARCHAR(64),
    serialdate VARCHAR(8) NOT NULL,
    serialnum DECIMAL(10) DEFAULT 0,
    ttl DECIMAL(10) DEFAULT 0,
    refresh DECIMAL(10) DEFAULT 0,
    retry DECIMAL(10) DEFAULT 0,
    expire DECIMAL(10) DEFAULT 0,
    minimum DECIMAL(10) DEFAULT 0,
    userid VARCHAR(40),
    lastexp DATE,
    slaveonly VARCHAR(1) DEFAULT 'N' NOT NULL,
    zonefilepath1 VARCHAR(254),
    zonefilepath2 VARCHAR(254),
    customer DECIMAL(10) DEFAULT 0,
    admingrp VARCHAR(40),
    PRIMARY KEY (data_id)
    );

    CREATE SEQUENCE SEQ_fwdzone ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_fwdzone BEFORE insert ON fwdzone FOR EACH ROW WHEN
    (NEW.data_id IS NULL OR NEW.data_id = 0) BEGIN select SEQ_fwdzone.nextval into :new.data_id from
    dual; END;;

    CREATE INDEX fwdzone_customer ON fwdzone (customer);

    CREATE INDEX fwdzone_domain ON fwdzone (domain);

    CREATE TABLE fwdzoneadd (
    customer DECIMAL(10) DEFAULT 0,
    data_id DECIMAL(20) DEFAULT 0,
    info VARCHAR(4000),
    infobinfn VARCHAR(255)
    );

    CREATE UNIQUE INDEX fwdzoneadd_customer ON fwdzoneadd (customer, data_id);

    CREATE TABLE fwdzonerec (
    recidx DECIMAL(20) NOT NULL,
    data_id DECIMAL(20) DEFAULT 0,
    lastmod DATE,
    host VARCHAR(254) NOT NULL,
    recordtype VARCHAR(5) NOT NULL,
    ip_hostname VARCHAR(254) NOT NULL,
    error_message VARCHAR(254),
    sortorder DECIMAL(10) DEFAULT 0,
    userid VARCHAR(40) NOT NULL,
    customer DECIMAL(10) DEFAULT 0,
    PRIMARY KEY (recidx)
    );

    CREATE SEQUENCE SEQ_fwdzonerec ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_fwdzonerec BEFORE insert ON fwdzonerec FOR EACH ROW WHEN
    (NEW.recidx IS NULL OR NEW.recidx = 0) BEGIN select SEQ_fwdzonerec.nextval into :new.recidx from
    dual; END;;

    CREATE INDEX fwdzonerec_data_id ON fwdzonerec (data_id);

    CREATE INDEX fwdzonerec_sortorder ON fwdzonerec (sortorder);

    CREATE INDEX fwdzonerec_customer ON fwdzonerec (customer);

    CREATE TABLE fwddns (
    id DECIMAL(20) DEFAULT 0,
    hname VARCHAR(100) NOT NULL,
    horder DECIMAL(3) DEFAULT 0
    );

    CREATE INDEX fwddns_id ON fwddns (id);

    CREATE TABLE zones (
    id DECIMAL(20) NOT NULL,
    zoneip DECIMAL(20) DEFAULT 0,
    zonesize DECIMAL(20) DEFAULT 0,
    zone VARCHAR(254) NOT NULL,
    error_message VARCHAR(254),
    lastmod DATE,
    serialdate VARCHAR(8) NOT NULL,
    serialnum DECIMAL(10) DEFAULT 0,
    ttl DECIMAL(10) DEFAULT 0,
    refresh DECIMAL(10) DEFAULT 0,
    retry DECIMAL(10) DEFAULT 0,
    expire DECIMAL(10) DEFAULT 0,
    minimum DECIMAL(10) DEFAULT 0,
    userid VARCHAR(40),
    lastexp DATE,
    slaveonly VARCHAR(1) DEFAULT 'N' NOT NULL,
    zonefilepath1 VARCHAR(254),
    zonefilepath2 VARCHAR(254),
    responsiblemail VARCHAR(64),
    customer DECIMAL(10) DEFAULT 0,
    PRIMARY KEY (id)
    );

    CREATE SEQUENCE SEQ_zones ;

    CREATE OR REPLACE TRIGGER TRIG_SEQ_zones BEFORE insert ON zones FOR EACH ROW WHEN (NEW.id IS NULL
    OR NEW.id = 0) BEGIN select SEQ_zones.nextval into :new.id from dual; END;;

    CREATE INDEX zones_customer ON zones (customer);

    CREATE INDEX zones_zoneip ON zones (zoneip);

    CREATE TABLE zonedns (
    id DECIMAL(20) DEFAULT 0,
    hname VARCHAR(100) NOT NULL,
    horder DECIMAL(3) DEFAULT 0
    );

    CREATE INDEX zonedns_id ON zonedns (id);

    INSERT INTO schema (version) VALUES (20);

    COMMIT;

    #The above commands need to be executed by the administrator to create the database schema for
    IPplan

     
  • Logged In: YES
    user_id=230197

    Just did exactly the same thing with my install of 10g
    express on windows and do not have the same issue. Creating
    users/groups works just fine. For example line 121 in
    usermanager.php relates to this code:

    $result=&$ds->ds->Execute("SELECT userid, grp
    FROM usergrp
    ORDER BY grp");
    // Build a group mapper.

    $lst=array();
    $mgrp="";
    $muid="";
    while($row = $result->FetchRow()) {
    $mgrp=$row["grp"];

    It could only throw an exception if the query above failed.
    Reason for a failed query will be apparent if dbf_debug is
    TRUE in config.php. I guess this is an Oracle permission
    problem?

     
  • Logged In: NO

    OK I found what was wrong.
    I used oci8 adodb oracle driver which returns column names in upper case - it is not compatible with parts of
    ipplan php code like this:
    $result=&$ds->ds->Execute("SELECT * FROM grp WHERE grp=".$ds->ds->qstr($grp));
    $row=$result->FetchRow();
    $grpdescrip=$row["grpdescrip"];
    $createcust=$row["createcust"];
    $grpopt =$row["grpopt"];
    $resaddr =$row["resaddr"];

    where column names are in lower case.

    Using oci8po driver fixes this issue.
    Anyway thanks a lot to all answered.

     
  • Logged In: YES
    user_id=230197
    Originator: NO

    Abort in schemacreate.php if trying to use oci8 driver.

     
    • status: open --> closed