Пример #1
0
                        unset($db);
                        echo 'Successfully added channel ' . htmlentities($name);
                    } else {
                        echo 'Channel ' . htmlentities($name) . ' does not exist or the page is down';
                    }
                } else {
                    unset($ws);
                    echo htmlentities($id) . ' is not a valid channel id';
                }
            } else {
                echo 'Channel name max of 20 characters, id max of 48 characters';
            }
        } else {
            if (!empty($_POST['delete']) && !empty($_POST['name'])) {
                $delete = $_POST['delete'];
                $name = $_POST['name'];
                if (ctype_digit($delete)) {
                    $db = new Datastore();
                    $query = 'DELETE FROM channels
                          WHERE id = ?';
                    $options = array('i', &$delete);
                    $db->query($query, $options);
                    unset($db);
                    echo 'Successfully deleted channel ' . htmlentities($name);
                }
            } else {
                echo 'Form missing required fields';
            }
        }
    }
}
Пример #2
0
 public function hasUniqueEmailAddress(Datastore $oDB)
 {
     if (!isset($this->emailAddress)) {
         return true;
     }
     try {
         $users = $oDB->newQuery()->findFirst('User')->withForeignKeys(array('emailAddress' => $this->emailAddress))->go();
     } catch (Datastore_E_RetrieveFailed $e) {
         return true;
     }
     return false;
 }
Пример #3
0
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server', 'name', 'My LDAP Server');
/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
// $servers->setValue('server','host','127.0.0.1');
/* The port your LDAP server listens on (no quotes). 389 is standard. */
// $servers->setValue('server','port',389);
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
Пример #4
0
/*********************************************/
/* Use this array if you want to have your attributes displayed in a specific
   order. You can use default attribute names or their fridenly names.
   For example, "sn" will be displayed right after "givenName". All the other
   attributes that are not specified in this array will be displayed after in
   alphabetical order. */
// $config->custom->appearance['attr_display_order'] = array();
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************/
/* Define your LDAP servers in this section  */
/*********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
$servers->setValue('server', 'name', 'Samba4 AD Server');
$servers->setValue('server', 'host', 'ldapi://%2Fvar%2Flib%2Fsamba%2Fprivate%2Fldapi');
$servers->setValue('login', 'auth_type', 'session');
$servers->setValue('login', 'attr', 'dn');
$servers->SetValue('login', 'bind_id', 'cn=Administrator,cn=Users,CHANGETHISBASE');
Пример #5
0
 function process_and_tag_to_datastore()
 {
     # get tags for file
     # store file and tags in datastore
     $o_Datastore = new Datastore();
     $o_Datastore->_add_file($this->filename);
     // generate tags for the file with different methods, then add what tags we have (if any) to the datastore for the file
     $sa_tags_for_file = array();
     foreach ($this->_sa_tags_from_filename() as $tag) {
         array_push($sa_tags_for_file, $tag);
     }
     if (count($sa_tags_for_file)) {
         $o_Datastore->_add_file_tags($this->filename, $sa_tags_for_file);
     } else {
         echo "no tags<br/>";
     }
     $o_Datastore->b_save_datastore("file_tags");
 }
Пример #6
0
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );

/*********************************************/
/* Define your LDAP servers in this section  */
/*********************************************/

$servers = new Datastore();

/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');

/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server','name','LDAP Server LCS');

/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
$servers->setValue('server','host',$ldap_server);
Пример #7
0
 /**
  *
  * @param       Datastore $oDB
  *              the datastore to search for the record
  * @param       array $aConditions
  *              The criteria to use to search for the record
  */
 public function findByKey($oDB, $aConditions)
 {
     constraint_mustBeArray($aConditions);
     $oAdapter = $oDB->getAdapterFor($this);
     $return = $oAdapter->findByKey($this, $aConditions);
     if (!$return) {
         // we did not find the record
         //
         // if the record is expected to exist, we throw
         // an exception
         $oDef = $this->oModel->getDefinition();
         $mustExist = false;
         foreach ($aConditions as $field => $value) {
             if ($oDef->isValidFieldName($field) && $oDef->isMandatoryField($field)) {
                 $mustExist = true;
             }
         }
         if ($mustExist) {
             throw new Datastore_E_RelatedDataNotFound($oDef->getModelName(), $aConditions);
         } else {
             return false;
         }
     }
     return true;
 }
Пример #8
0
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************/
/* Define your LDAP servers in this section  */
/*********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server', 'name', 'My LDAP Server');
/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
// $servers->setValue('server','host','127.0.0.1');
/* The port your LDAP server listens on (no quotes). 389 is standard. */
// $servers->setValue('server','port',389);
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
Пример #9
0
<?php

# search pics from datastore, render them with pagination
include '../../flot_flot/core/base.php';
include S_BASE_PATH . 'flot_flot/core/datastore.php';
$s_mode = "browse";
if (isset($_GET['mode'])) {
    $s_mode = $_GET['mode'];
}
$s_query = "";
if (isset($_GET['term'])) {
    $s_query = strtolower($_GET['term']);
}
$o_Datastore = new Datastore();
$s_return_html = "<script>var s_upload_dir = '" . $o_Datastore->settings->upload_dir . "';</script>";
$s_upload_dir = $o_Datastore->settings->upload_dir;
$oa_search_results = $o_Datastore->oa_search_pictures($s_query);
foreach ($oa_search_results as $o_image) {
    $s_file_url = substr(S_BASE_EXTENSION, 0, -1) . "/" . $s_upload_dir . "small/" . $o_image;
    $s_file_name = $o_image;
    $s_onclick = "_lightbox('{$s_file_url}');";
    if ($s_mode === "select") {
        $s_onclick = "select_picture('{$s_file_name}');";
    }
    $s_return_html .= '<img id="' . $o_image . '" onclick="' . $s_onclick . '" src="' . $s_file_url . '"/>';
}
if (count($oa_search_results) === 0) {
    $s_return_html = "no results.. :(";
}
echo $s_return_html;
Пример #10
0
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server', 'name', 'My LDAP Server');
/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
$servers->setValue('server', 'host', '127.0.0.1');
/* The port your LDAP server listens on (no quotes). 389 is standard. */
// $servers->setValue('server','port',389);
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
Пример #11
0
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server', 'name', 'Local LDAP Server');
/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
$servers->setValue('server', 'host', '127.0.0.1');
/* The port your LDAP server listens on (no quotes). 389 is standard. */
$servers->setValue('server', 'port', 389);
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
Пример #12
0
 public function store(Datastore $oDB = null)
 {
     if ($oDB == null && $this->datastoreProxy == null) {
         // TODO: throw a better exception here
         throw new Exception();
     }
     if ($this->datastoreProxy == null) {
         $this->datastoreProxy = $oDB->getNewDatastoreProxy($this);
     }
     return $this->datastoreProxy->store($oDB);
 }
Пример #13
0
#  $config->custom->appearance['attr_display_order'] = array(
#   'givenName',
#   'sn',
#   'cn',
#   'displayName',
#   'uid',
#   'uidNumber',
#   'gidNumber',
#   'homeDirectory',
#   'mail',
#   'userPassword'
#  );
/*********************************************
 * Define your LDAP servers in this section  *
 *********************************************/
$servers = new Datastore();
/* $servers->NewServer('ldap_pla') must be called before each new LDAP server
   declaration. */
$servers->newServer('ldap_pla');
/* A convenient name that will appear in the tree viewer and throughout
   phpLDAPadmin to identify this LDAP server to users. */
$servers->setValue('server', 'name', 'My LDAP Server');
/* Examples:
   'ldap.example.com',
   'ldaps://ldap.example.com/',
   'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
           (Unix socket at /usr/local/var/run/ldap) */
$servers->setValue('server', 'host', '127.0.0.1');
/* The port your LDAP server listens on (no quotes). 389 is standard. */
// $servers->setValue('server','port',389);
/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
Пример #14
0
            <option value="5" ' . ($date === '5' ? 'selected="selected"' : '') . '>Anytime</option>
        </select>
    </div>';
echo '<div>
        <span>Max Videos</span>
        <select onchange="setOption(\'max\')" id="max">
            <option value="1" ' . ($max === '1' ? 'selected="selected"' : '') . '>1</option>
            <option value="2" ' . ($max === '2' ? 'selected="selected"' : '') . '>2</option>
            <option value="3" ' . ($max === '3' ? 'selected="selected"' : '') . '>3</option>
            <option value="4" ' . ($max === '4' ? 'selected="selected"' : '') . '>4</option>
            <option value="30" ' . ($max === '30' ? 'selected="selected"' : '') . '>All</option>
        </select>
    </div>';
echo '</div>';
echo '<iframe style="display: none;width: 560px;height:315px;" id="frame" allowfullscreen></iframe><div id="frame-hover"></div>';
$db = new Datastore();
$db->tables();
$db->query("SELECT id, name, channel, type FROM channels ORDER BY name");
$channels = $db->fetch();
unset($db);
$ws = new Scraper();
foreach ($channels as $channel) {
    $ws->addChannel($channel['channel'], $sort, $channel['type']);
}
$ws->fetch();
foreach ($channels as $channel) {
    $counter = 0;
    $maxVideos = 1;
    $videos = $ws->fetchChannel($channel['channel'], !empty($auto));
    echo "<div class=\"channel\"><button class=\"channel-button\" onclick=\"hideshow('channel-{$channel['id']}', 200);\">{$channel['name']}</button></div>";
    echo "<div id=\"channel-{$channel['id']}\">";
Пример #15
0
function defineDatastoreTestStorage_RDBMS(Datastore $oDB)
{
    // define the storage for the models
    $oDB->storeModel('Test_Customer')->inTable('customers');
    /*
           $oDB->storeModel('Test_PremiumCustomer')
               ->inTable('premiumCustomers');
    */
    $oDB->storeModel('Test_Order')->inTable('orders');
    $oDB->storeModel('Test_OrderContent')->inTable('orderContents');
    $oDB->storeModel('Test_Product')->inTable('products');
    $oDB->storeModel('Test_RelatedProducts')->inTable('relatedProducts');
    $oDB->storeModel('Test_Product_Tag')->inTable('productTags');
}