comparison lucene/src/luan/modules/lucene/Lucene.luan @ 753:5e3970ccd86a

improve password handling
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 15 Jul 2016 17:35:50 -0600
parents 85f5444fb7d4
children 1a101ac9ea46
comparison
equal deleted inserted replaced
752:ea5f3a254b76 753:5e3970ccd86a
7 local Io = require "luan:Io.luan" 7 local Io = require "luan:Io.luan"
8 local uri = Io.uri or error() 8 local uri = Io.uri or error()
9 local String = require "luan:String.luan" 9 local String = require "luan:String.luan"
10 local matches = String.matches or error() 10 local matches = String.matches or error()
11 local Rpc = require "luan:Rpc.luan" 11 local Rpc = require "luan:Rpc.luan"
12 local Hosting = require "luan:host/Hosting.luan"
13 local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex" 12 local LuceneIndex = require "java:luan.modules.lucene.LuceneIndex"
14 local NumberFieldParser = require "java:luan.modules.lucene.queryparser.NumberFieldParser" 13 local NumberFieldParser = require "java:luan.modules.lucene.queryparser.NumberFieldParser"
15 local StringFieldParser = require "java:luan.modules.lucene.queryparser.StringFieldParser" 14 local StringFieldParser = require "java:luan.modules.lucene.queryparser.StringFieldParser"
16 local SaneQueryParser = require "java:luan.modules.lucene.queryparser.SaneQueryParser" 15 local SaneQueryParser = require "java:luan.modules.lucene.queryparser.SaneQueryParser"
17 local Version = require "java:org.apache.lucene.util.Version" 16 local Version = require "java:org.apache.lucene.util.Version"
114 end ) 113 end )
115 end 114 end
116 115
117 if Rpc.functions.backup == nil then 116 if Rpc.functions.backup == nil then
118 function Rpc.functions.lucene_backup(password) 117 function Rpc.functions.lucene_backup(password)
119 if Hosting.password ~= nil and Hosting.password ~= password then 118 if Io.password ~= password then
120 error "wrong password" 119 error "wrong password"
121 end 120 end
122 local zip_file = uri("file:"..index.dir).parent().child("backup.zip") 121 local zip_file = uri("file:"..index.dir).parent().child("backup.zip")
123 index.zip(zip_file) 122 index.zip(zip_file)
124 return zip_file 123 return zip_file