我是Nodejs的新手,正在寻找用户凭证管理,我认为Passport是个不错的选择.
但在Passport的注册策略中,我只看到保存的用户信息是电子邮件和密码.
我需要更多的用户信息,如全名,工作,注册时间,上次活动时间等.
那么我怎样才能在Passport中做到这一点?
我的脚本位于: C:\A\B\test.bat
在脚本中,我通过命令获取脚本的父目录: parent_dir=~dp0
=> 我得到:C:\A\B
那么我怎样才能获得父目录的父级:C:\A并设置为一个变量
我有以下字符串:
char str[] = "A/USING=B)";
Run Code Online (Sandbox Code Playgroud)
我想分获得独立的A和B值与/USING=作为分隔符
我该怎么做?我知道,strtok()但它只是被一个字符分割为分隔符。
我需要创建一个包含依赖项的OSGi包,我正在使用maven-assembly-plugin,这是我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>logstat</artifactId>
<packaging>bundle</packaging>
<name>Log Stat Demo</name>
<version>1.0</version>
<groupId>org.test</groupId>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>yecht</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>activator.*,service.*,impl.*</Export-Package>
<Bundle-Activator>activator.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>activator.Activator</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-my-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
当我运行maven build时,它创建了2个jars文件,一个带有依赖项,一个没有
但是在具有依赖关系的那个中,MANIFEST.MF不包括OSGi配置,如:
Manifest-Version: 1.0
Bnd-LastModified: 1392281245886
Build-Jdk: 1.6.0_45
Built-By: myname
Bundle-Activator: activator.Activator
Bundle-ManifestVersion: …Run Code Online (Sandbox Code Playgroud) 以下是我的代码:
#include "stdio.h"
#include "time.h"
#include "string.h"
#include "cJSON.h"
#include "stdlib.h"
int checkUserRole(char *cmd);
int main(){
char *cmd = "zwr ^A(\"A\")"; //string: zwr ^A("A")
int v = checkUserRole(cmd);
printf("%d",v);
return 0;
}
int checkUserRole(char *cmd)
{
const char *u ;
u = getenv("USER");
char *token;
char *cmd_w_g;
char *limiter ;
if(strstr(cmd,"(") != NULL){
limiter = "(";
token = strtok(cmd,limiter);
cmd_w_g = token;
}
char *cmd_qualifier;
limiter = " ^";
cmd_qualifier = strtok(cmd_w_g,limiter);
char *cmd_q;
cmd_q = cmd_qualifier;
char *gbl ; …Run Code Online (Sandbox Code Playgroud) 我使用表单字段并像这样设置标签:
<?= $form->field($unit, 'estimated_time')->textInput(['style' => 'width: 50px'])->label("Minutes") ?>
Run Code Online (Sandbox Code Playgroud)
但是标签显示在输入字段的左侧 如何在右侧显示它?
我读了GT.M安全文档并看到GT.M不包含特定的安全解决方案,它依赖于OS系统用户角色
现在我希望每个用户在数据库上都有特定的角色,我该怎么做
示例:
用户'经理'可以对全局"账户","薪水"执行SET,KILL命令
用户'员工'只能在全局"薪水"上执行ZWRITE命令
假设"Account"和"Salary"全局变量映射在同一个数据库文件中
谢谢,
我使用 Windows 10 Creator 并想要制作 php 示例进行测试,但是当从命令行运行时,它只显示代码
G:\xampp\htdocs\chat-box>php -v
PHP 5.6.30 (cli) (built: Jan 18 2017 19:48:22)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
G:\xampp\htdocs\chat-box>php bin\chat_server.php
use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
use ChatWebSocket\Chat;
require dirname(__DIR__) . '/vendor/autoload.php';
$server = IoServer::factory(
new HttpServer(
new WsServer(
new Chat()
)
),
8080
);
print("Hello WebSocket!")
$server->run();
G:\xampp\htdocs\chat-box>
Run Code Online (Sandbox Code Playgroud)
我以前从未得到过这个。我的命令有问题吗?