mirror of
				https://github.com/9001/copyparty.git
				synced 2025-11-04 05:43:17 +00:00 
			
		
		
		
	shares: move all config to webroot
This commit is contained in:
		@@ -5659,15 +5659,15 @@ class HttpCli(object):
 | 
				
			|||||||
                raise Pebkac(500, "sqlite3 not found on server; sharing is disabled")
 | 
					                raise Pebkac(500, "sqlite3 not found on server; sharing is disabled")
 | 
				
			||||||
            raise Pebkac(500, "server busy, cannot create share; please retry in a bit")
 | 
					            raise Pebkac(500, "server busy, cannot create share; please retry in a bit")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        skey = self.uparam.get("skey") or self.vpath.split("/")[-1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.args.shr_v:
 | 
					        if self.args.shr_v:
 | 
				
			||||||
            self.log("handle_eshare: " + self.req)
 | 
					            self.log("handle_eshare: " + skey)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cur = idx.get_shr()
 | 
					        cur = idx.get_shr()
 | 
				
			||||||
        if not cur:
 | 
					        if not cur:
 | 
				
			||||||
            raise Pebkac(400, "huh, sharing must be disabled in the server config...")
 | 
					            raise Pebkac(400, "huh, sharing must be disabled in the server config...")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        skey = self.vpath.split("/")[-1]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        rows = cur.execute("select un, t1 from sh where k = ?", (skey,)).fetchall()
 | 
					        rows = cur.execute("select un, t1 from sh where k = ?", (skey,)).fetchall()
 | 
				
			||||||
        un = rows[0][0] if rows and rows[0] else ""
 | 
					        un = rows[0][0] if rows and rows[0] else ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,11 @@
 | 
				
			|||||||
 | 
					var SRS = SR.trimEnd('/') + '/';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var t = QSA('a[k]');
 | 
					var t = QSA('a[k]');
 | 
				
			||||||
for (var a = 0; a < t.length; a++)
 | 
					for (var a = 0; a < t.length; a++)
 | 
				
			||||||
    t[a].onclick = rm;
 | 
					    t[a].onclick = rm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function rm() {
 | 
					function rm() {
 | 
				
			||||||
    var u = SR + shr + uricom_enc(this.getAttribute('k')) + '?eshare=rm',
 | 
					    var u = SRS + '?eshare=rm&skey=' + uricom_enc(this.getAttribute('k')),
 | 
				
			||||||
        xhr = new XHR();
 | 
					        xhr = new XHR();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    xhr.open('POST', u, true);
 | 
					    xhr.open('POST', u, true);
 | 
				
			||||||
@@ -13,7 +15,7 @@ function rm() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function bump() {
 | 
					function bump() {
 | 
				
			||||||
    var k = this.closest('tr').getElementsByTagName('a')[2].getAttribute('k'),
 | 
					    var k = this.closest('tr').getElementsByTagName('a')[2].getAttribute('k'),
 | 
				
			||||||
        u = SR + shr + uricom_enc(k) + '?eshare=' + this.value,
 | 
					        u = SRS + '?skey=' + uricom_enc(k) + '&eshare=' + this.value,
 | 
				
			||||||
        xhr = new XHR();
 | 
					        xhr = new XHR();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    xhr.open('POST', u, true);
 | 
					    xhr.open('POST', u, true);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user