]> git.nbdom.net Git - nb.git/commitdiff
playing
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 3 Sep 2016 17:50:16 +0000 (18:50 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 3 Sep 2016 17:50:16 +0000 (18:50 +0100)
bin/nb-repo-dirs
etc/dbs.php
etc/dbs/owncloud.php
etc/profile.d/nb.sh
etc/repo-dirs.conf
lib/php/nb.php

index a8f136d78cef485aac67082ba96d4423abedc0ef..04407b617d79ad4f1f3f02bf5d187452dd3e500f 100755 (executable)
@@ -8,6 +8,10 @@ use strict;
 use File::Spec;
 use Cwd;
 use File::Basename;
+my @FILES_CHECK = (
+  '.nb-install',
+  '.nb-update',
+);
 my $FILE_EXISTS = '.nb-install';
 
 my $NB_ROOT = dirname ( dirname ( File::Spec->rel2abs( Cwd::abs_path(__FILE__) ) ) );
@@ -36,17 +40,22 @@ print
        grep {$_ ne "" and !$h{$_}++}
        map {
 
-    # To reduce glob return, we permit to use file
+    # To reduce glob return, we permit to use file as filter
                my $dir =  (-e $_ and !-d  $_) ? dirname($_) : $_;
 
-               if (-d "$dir/.git") {
-      warn "DEBUG: MISSING: $dir/$FILE_EXISTS\n" if $DEBUG and !-r "$dir/$FILE_EXISTS";
-      add_args($dir);
-                       #$dir;
-               } else {
+    # Check is git
+               if (!-d "$dir/.git") {
       warn "DEBUG: REJECT : $dir\n" if $DEBUG;
                        "";
-               }
+      continue;
+    }
+
+    if ($DEBUG) {
+      for (@FILES_CHECK) {
+        warn "DEBUG: MISSING: $dir/$_\n" if !-r "$dir/$_";
+      }
+    }
+    add_args($dir);
 
        }
        glob join(' ',@DIRS)
index 7fc09237ad9d52971976f7cd01cadd8c8975f8d2..5fa65b0c8e3c11931026ac8e1a538ea2d1328269 100644 (file)
@@ -8,7 +8,7 @@ $LOCAL_DB = (
 ) ? true : false;
 
 # Look for sqlite db path
-$DIR_SQLITE = '~nicoadm/ownCloud';
+$DIR_SQLITE = '';
 foreach ([
   '~nico/ownCloud',
   '~nicoadm/ownCloud',
index 0fdb37f2a48245ca14e030ed77a77ebbdf49d7d0..27653062c2e0793d40a98dabfd15e84fd17ec09b 100644 (file)
@@ -2,7 +2,7 @@
 $CONF['owncloud'] = [
   'host' => "$DIR_SQLITE/owncloud.db",
   'type' => 'sqlite',
-  'default_table' => 'oc_users',
+  #'default_table' => 'oc_users',
   'default_table' => 'last_files',
   'tables' => [
     'last_files' => [
index 14e73827a5400b5558e2018514137aa530b67cfe..fe2f7125a4c2811ae06e7487b6eca11a1b2834ca 100644 (file)
@@ -1,3 +1,16 @@
+nb_repos_commit_push() {
+  shell_help "Commit each repos whith a comment" "$@" && return
+  local status
+  local pwd=`pwd`
+  for i in $(nb-repo-dirs); do
+    cd "$i" || continue
+
+    printf ">%s\n" "$i"
+    git commit -a -m "$*" && git push | sed 's/^/ /'
+  done
+  cd "$pwd"
+}
+
 nb_repos_status() {
   shell_help "List repos git status" "$@" && return
   local status
index 1f72ca8882352a02972d05f5d2ba855f65e6327a..fe293c3c09fa0bb2d158978295eb7440c753f92b 100644 (file)
@@ -1 +1 @@
-/{opt,opt/www,etc,home,home/www,usr/local/src,home/*/Dev,home/share/git}/*/.nb-install
+/{opt,opt/www,etc,home,home/www,usr/local/src,home/*/Dev,home/share/git}/*/.nb-{install,update}
index e242ec6352251c1bc91d4d4736695490dc9a257d..bd1fe8cc1ad3c3f963254175a47219ca4b4d5f88 100644 (file)
@@ -727,5 +727,16 @@ class NB {
     exit;
   }
 
+  public static function oc_password_verify($pass) {
+    require_once "/home/owncloud/config/config.php";
+    require_once '/opt/owncloud/lib/base.php';
+    require_once '/opt/owncloud/lib/private/Security/Hasher.php';
+    return \OC::$server->getHasher()->hash($pass);
+    $l = new Hasher($CONFIG);
+    debug($l->legacyHashVerify($pass,"YbS9N9cK8TY6b7oyw3skfcHykXIjlx"));
+    return $CONFIG;
+    debug($CONF);
+  }
+
 } # < Class
 ?>